mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-21 12:30:16 +08:00
BUG: support passing an empty list to data methods.
Our type checking code was a bit too aggressive.
This commit is contained in:
@@ -1905,6 +1905,21 @@ def handle_data(context, data):
|
||||
|
||||
self.assertEqual(expected, cm.exception.args[0])
|
||||
|
||||
def test_empty_asset_list_to_history(self):
|
||||
algo = TradingAlgorithm(
|
||||
script=dedent("""
|
||||
def initialize(context):
|
||||
pass
|
||||
|
||||
def handle_data(context, data):
|
||||
data.history([], "price", 5, '1d')
|
||||
"""),
|
||||
sim_params=self.sim_params,
|
||||
env=self.env
|
||||
)
|
||||
|
||||
algo.run(self.data_portal)
|
||||
|
||||
|
||||
class TestGetDatetime(TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user