MAINT: Clean up WithTradingSessions.

- Add WithDefaultDateBounds, since we use alias('START_DATE') and
  alias ('END_DATE').

- Fix copypasta in assertion.
This commit is contained in:
Scott Sanderson
2016-08-15 22:56:45 -04:00
parent fecfca9c59
commit 0f4964fdfa
+2 -2
View File
@@ -527,7 +527,7 @@ class WithSimParams(WithTradingEnvironment):
cls.sim_params = cls.make_simparams()
class WithTradingSessions(WithTradingCalendars):
class WithTradingSessions(WithTradingCalendars, WithDefaultDateBounds):
"""
ZiplineTestCase mixin providing cls.trading_days, cls.all_trading_sessions
as a class-level fixture.
@@ -1212,7 +1212,7 @@ class WithSeededRandomPipelineEngine(WithTradingSessions, WithAssetFinder):
if start_date not in self.trading_days:
raise AssertionError("Start date not in calendar: %s" % start_date)
if end_date not in self.trading_days:
raise AssertionError("Start date not in calendar: %s" % start_date)
raise AssertionError("End date not in calendar: %s" % end_date)
return self.seeded_random_engine.run_pipeline(
pipeline,
start_date,