From 5e7e56176f13c480012a1bae975813f9babaa3a5 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Wed, 17 Aug 2016 14:30:41 -0400 Subject: [PATCH] BUG: Fix broken fixture resolution. Make sure that WithDefaultDateBounds is last in everyone's mro(). --- zipline/testing/fixtures.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zipline/testing/fixtures.py b/zipline/testing/fixtures.py index 88af7f1d..88d31f4d 100644 --- a/zipline/testing/fixtures.py +++ b/zipline/testing/fixtures.py @@ -235,6 +235,9 @@ class WithDefaultDateBounds(object): ZiplineTestCase mixin which makes it possible to synchronize date bounds across fixtures. + This fixture should always be the last fixture in bases of any fixture or + test case that uses it. + Attributes ---------- START_DATE : datetime @@ -420,7 +423,9 @@ class WithTradingCalendars(object): cls.trading_calendars[exchange] = get_calendar(cal_str) -class WithTradingEnvironment(WithAssetFinder, WithTradingCalendars): +class WithTradingEnvironment(WithAssetFinder, + WithTradingCalendars, + WithDefaultDateBounds): """ ZiplineTestCase mixin providing cls.env as a class-level fixture.