mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-12 11:50:11 +08:00
MAINT: Use six for Python 3 compatible names and behavior.
Use the six module to import functions and types that are consistent between Python 2 and 3, so that one code base can support both versions. - Use integer types instead of int and long. - Use string_types instead of basestring. - Account for iteritems, itervalues, iterkeys. - Use six.moves for filter and zip, reduce - Use compatible bytes for md5 hasher. - xrange and range
This commit is contained in:
@@ -20,6 +20,8 @@ import pandas as pd
|
||||
from datetime import timedelta, datetime
|
||||
from unittest import TestCase
|
||||
|
||||
from six.moves import range
|
||||
|
||||
from zipline.utils.test_utils import setup_logger
|
||||
|
||||
from zipline.protocol import Event
|
||||
@@ -64,7 +66,7 @@ class TestEventWindow(TestCase):
|
||||
|
||||
self.monday = datetime(2012, 7, 9, 16, tzinfo=pytz.utc)
|
||||
self.eleven_normal_days = [self.monday + i * timedelta(days=1)
|
||||
for i in xrange(11)]
|
||||
for i in range(11)]
|
||||
|
||||
# Modify the end of the period slightly to exercise the
|
||||
# incomplete day logic.
|
||||
@@ -75,7 +77,7 @@ class TestEventWindow(TestCase):
|
||||
# Second set of dates to test holiday handling.
|
||||
self.jul4_monday = datetime(2012, 7, 2, 16, tzinfo=pytz.utc)
|
||||
self.week_of_jul4 = [self.jul4_monday + i * timedelta(days=1)
|
||||
for i in xrange(5)]
|
||||
for i in range(5)]
|
||||
|
||||
def test_market_aware_window_normal_week(self):
|
||||
window = NoopEventWindow(
|
||||
|
||||
Reference in New Issue
Block a user