TST: Make room for multiple calendars in tests.

When adding fixtures for futures data, there will be a need for multiple
calendars in the fixture ecosystem. e.g. a test that includes both
equities and futures would need an overall calendar which encompasses
both equities and futures; however, the test data for equities should
still still be limited to the bounds set by the NYSE calendar.

Make the fixtures that setup trading calendars and values dervied from
the trading calendar (e.g. trading sessions) accept an iterable of
calendars which need to be created, then populate those values into a
dict keyed by the calendar name.

Change `WithNYSETradingDays` to include sessions in the name,
since we are moving to session as the name for the 'day' unit.

Provide `trading_days` which is really "NYSE trading sessions` on
`WithTradingSessions` for backwards compatibility.
This commit is contained in:
Eddie Hebert
2016-08-02 13:19:45 -04:00
parent 7075a24ba7
commit e934c6aeaf
9 changed files with 97 additions and 43 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ from zipline.testing.fixtures import (
WithSimParams,
WithTradingEnvironment,
WithTmpDir,
WithTradingCalendar,
WithTradingCalendars,
ZiplineTestCase,
)
from zipline.test_algorithms import (
@@ -3500,7 +3500,7 @@ class TestOrderCancelation(WithDataPortal,
self.assertFalse(log_catcher.has_warnings)
class TestEquityAutoClose(WithTmpDir, WithTradingCalendar, ZiplineTestCase):
class TestEquityAutoClose(WithTmpDir, WithTradingCalendars, ZiplineTestCase):
"""
Tests if delisted equities are properly removed from a portfolio holding
positions in said equities.