From 50de0f5e396ee63bfbea91e2770f3184e67a9904 Mon Sep 17 00:00:00 2001 From: fawce Date: Wed, 12 Sep 2012 00:30:37 -0400 Subject: [PATCH] support of qexec refactoring --- tests/test_exception_handling.py | 1 - tests/test_finance.py | 2 -- tests/test_optimize.py | 3 --- zipline/lines.py | 4 ++-- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/test_exception_handling.py b/tests/test_exception_handling.py index 3a403f9a..0594353d 100644 --- a/tests/test_exception_handling.py +++ b/tests/test_exception_handling.py @@ -21,7 +21,6 @@ from zipline.utils.test_utils import ( DEFAULT_TIMEOUT = 15 # seconds EXTENDED_TIMEOUT = 90 -allocator = AddressAllocator(1000) class ExceptionTestCase(TestCase): diff --git a/tests/test_finance.py b/tests/test_finance.py index 1168902f..aab30554 100644 --- a/tests/test_finance.py +++ b/tests/test_finance.py @@ -12,7 +12,6 @@ from nose.tools import timed import zipline.utils.factory as factory from zipline.finance.trading import TradingEnvironment -from zipline.core.devsimulator import AddressAllocator from zipline.lines import SimulatedTrading from zipline.finance.performance import PerformanceTracker from zipline.utils.protocol_utils import ndict @@ -26,7 +25,6 @@ from zipline.utils.test_utils import \ DEFAULT_TIMEOUT = 15 # seconds EXTENDED_TIMEOUT = 90 -allocator = AddressAllocator(1000) class FinanceTestCase(TestCase): diff --git a/tests/test_optimize.py b/tests/test_optimize.py index c16454b1..365a2a23 100644 --- a/tests/test_optimize.py +++ b/tests/test_optimize.py @@ -12,8 +12,6 @@ from zipline.core.devsimulator import AddressAllocator DEFAULT_TIMEOUT = 15 # seconds EXTENDED_TIMEOUT = 90 -allocator = AddressAllocator(1000) - from zipline.utils.test_utils import setup_logger, teardown_logger class TestUpDown(TestCase): @@ -26,7 +24,6 @@ class TestUpDown(TestCase): def setUp(self): self.zipline_test_config = { - 'allocator' : allocator, 'sid' : 133, 'trade_count' : 5, 'amplitude' : 30, diff --git a/zipline/lines.py b/zipline/lines.py index 46fe5fa7..1bc5cc90 100644 --- a/zipline/lines.py +++ b/zipline/lines.py @@ -112,9 +112,9 @@ class SimulatedTrading(object): self.gen = self.trading_client.simulate(self.with_tnfms) def __iter__(self): - return self.gen + return self - def __next__(self): + def next(self): return self.gen.next() @staticmethod