mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-20 12:20:29 +08:00
TST: Fix broken tests, updated example data
This commit is contained in:
Binary file not shown.
@@ -163,7 +163,7 @@ from zipline.test_algorithms import (
|
||||
no_handle_data,
|
||||
)
|
||||
from zipline.utils.api_support import ZiplineAPI, set_algo_instance
|
||||
from zipline.utils.calendars import get_calendar
|
||||
from zipline.utils.calendars import get_calendar, register_calendar
|
||||
from zipline.utils.context_tricks import CallbackManager
|
||||
from zipline.utils.control_flow import nullctx
|
||||
import zipline.utils.events
|
||||
@@ -1453,6 +1453,8 @@ class TestAlgoScript(WithLogger,
|
||||
|
||||
@classmethod
|
||||
def make_equity_info(cls):
|
||||
register_calendar("TEST", get_calendar("NYSE"), force=True)
|
||||
|
||||
data = make_simple_equity_info(
|
||||
cls.sids,
|
||||
cls.START_DATE,
|
||||
@@ -1787,6 +1789,7 @@ def handle_data(context, data):
|
||||
Test that api methods on the data object can be called with positional
|
||||
arguments.
|
||||
"""
|
||||
|
||||
params = SimulationParameters(
|
||||
start_session=pd.Timestamp("2006-01-10", tz='UTC'),
|
||||
end_session=pd.Timestamp("2006-01-11", tz='UTC'),
|
||||
|
||||
@@ -431,6 +431,7 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
|
||||
'symbol': 'TEST.%d' % sid,
|
||||
'start_date': as_of.value,
|
||||
'end_date': as_of.value,
|
||||
'exchange': uuid.uuid4().hex
|
||||
}
|
||||
for sid in sids
|
||||
]
|
||||
@@ -480,8 +481,8 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
|
||||
def test_lookup_symbol_fuzzy(self):
|
||||
metadata = pd.DataFrame.from_records([
|
||||
{'symbol': 'PRTY_HRD', 'exchange': "TEST"},
|
||||
{'symbol': 'BRKA', 'exchange': "TEST",},
|
||||
{'symbol': 'BRK_A', 'exchange': "TEST",},
|
||||
{'symbol': 'BRKA', 'exchange': "TEST"},
|
||||
{'symbol': 'BRK_A', 'exchange': "TEST"},
|
||||
])
|
||||
self.write_assets(equities=metadata)
|
||||
finder = self.asset_finder
|
||||
@@ -524,11 +525,13 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
|
||||
'symbol': 'A',
|
||||
'start_date': T('2014-01-01'),
|
||||
'end_date': T('2014-01-05'),
|
||||
'exchange': "TEST",
|
||||
},
|
||||
{
|
||||
'symbol': 'B',
|
||||
'start_date': T('2014-01-06'),
|
||||
'end_date': T('2014-01-10'),
|
||||
'exchange': "TEST",
|
||||
},
|
||||
|
||||
# sid 1
|
||||
@@ -536,11 +539,13 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
|
||||
'symbol': 'C',
|
||||
'start_date': T('2014-01-01'),
|
||||
'end_date': T('2014-01-05'),
|
||||
'exchange': "TEST",
|
||||
},
|
||||
{
|
||||
'symbol': 'A', # claiming the unused symbol 'A'
|
||||
'start_date': T('2014-01-06'),
|
||||
'end_date': T('2014-01-10'),
|
||||
'exchange': "TEST",
|
||||
},
|
||||
],
|
||||
index=[0, 0, 1, 1],
|
||||
|
||||
Reference in New Issue
Block a user