From d9a1479db7dacb314ea0482afb2f963b2833b6e9 Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Tue, 20 Dec 2016 18:59:07 -0500 Subject: [PATCH] MAINT: Some cleanup while working on batch ordering --- tests/test_algorithm.py | 6 +++--- zipline/test_algorithms.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_algorithm.py b/tests/test_algorithm.py index 309d96a5..81e842ee 100644 --- a/tests/test_algorithm.py +++ b/tests/test_algorithm.py @@ -939,7 +939,7 @@ def before_trading_start(context, data): sim_params=self.sim_params, env=self.env, ) - # Ensure that the environment's asset 0 is a Future + # Ensure that the environment's asset 3 is a Future asset_to_test = algo.sid(3) self.assertIsInstance(asset_to_test, Future) @@ -1019,7 +1019,7 @@ def before_trading_start(context, data): sim_params = SimulationParameters( start_session=start_session, end_session=period_end, - capital_base=float("1.0e5"), + capital_base=1.0e5, data_frequency='minute', trading_calendar=self.trading_calendar, ) @@ -3701,7 +3701,7 @@ class TestEquityAutoClose(WithTmpDir, WithTradingCalendars, ZiplineTestCase): cls.first_asset_expiration = cls.test_days[2] def make_data(self, auto_close_delta, frequency, - capital_base=float("1.0e5")): + capital_base=1.0e5): asset_info = make_jagged_equity_info( num_assets=3, diff --git a/zipline/test_algorithms.py b/zipline/test_algorithms.py index 7fe1713d..aeb9279c 100644 --- a/zipline/test_algorithms.py +++ b/zipline/test_algorithms.py @@ -411,7 +411,7 @@ class TestTargetPercentAlgorithm(TradingAlgorithm): def handle_data(self, data): if not self.ordered: - assert 0 not in self.portfolio.positions + assert not self.portfolio.positions else: # Since you can't own fractional shares (at least in this # example), we want to make sure that our target amount is @@ -429,7 +429,7 @@ class TestTargetPercentAlgorithm(TradingAlgorithm): "Orders not filled at current price." self.sale_price = data.current(sid(0), "price") - self._order(self.sid(0), .002) + self._order(sid(0), .002) self.ordered = True def _order(self, asset, target):