Skip to content

Commit

Permalink
Merge ae7ed2c into 45257eb
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Sanderson committed Oct 14, 2017
2 parents 45257eb + ae7ed2c commit 74cfe8a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions tests/calendars/test_trading_calendar.py
Expand Up @@ -34,6 +34,7 @@
InvalidCalendarName,
)

from zipline.testing import slow
from zipline.testing.predicates import assert_equal
from zipline.utils.calendars import (
deregister_calendar,
Expand Down Expand Up @@ -264,6 +265,7 @@ def _verify_minute(self, calendar, minute,
prev_close_answer
)

@slow
def test_next_prev_open_close(self):
# for each session, check:
# - the minute before the open (if gaps exist between sessions)
Expand Down Expand Up @@ -358,6 +360,7 @@ def test_next_prev_minute(self):
self.calendar.previous_minute(hour_after_close)
)

@slow
def test_minute_to_session_label(self):
for idx, info in enumerate(self.answers[1:-2].iterrows()):
session_label = info[1].name
Expand Down Expand Up @@ -452,6 +455,7 @@ def test_minute_to_session_label(self):
(2, 0),
(2, 1),
])
@slow
def test_minute_index_to_session_labels(self, interval, offset):
minutes = self.calendar.minutes_for_sessions_in_range(
pd.Timestamp('2011-01-04', tz='UTC'),
Expand Down Expand Up @@ -664,6 +668,7 @@ def test_session_distance(self):
self.assertEqual(2, self.calendar.session_distance(sessions[0],
sessions[-1]))

@slow
def test_open_and_close_for_session(self):
for index, row in self.answers.iterrows():
session_label = row.name
Expand Down
2 changes: 2 additions & 0 deletions tests/pipeline/test_engine.py
Expand Up @@ -75,6 +75,7 @@
OpenPrice,
parameter_space,
product_upper_triangle,
slow,
)
from zipline.testing.fixtures import (
WithAdjustmentReader,
Expand Down Expand Up @@ -839,6 +840,7 @@ def base_mask(self):
def make_frame(self, data):
return DataFrame(data, columns=self.assets, index=self.dates)

@slow
def test_compute_with_adjustments(self):
dates, asset_ids = self.dates, self.asset_ids
low, high = USEquityPricing.low, USEquityPricing.high
Expand Down
3 changes: 2 additions & 1 deletion tests/pipeline/test_events.py
Expand Up @@ -24,7 +24,7 @@
normalize_timestamp_to_query_time,
previous_event_indexer,
)
from zipline.testing import check_arrays, ZiplineTestCase
from zipline.testing import check_arrays, slow, ZiplineTestCase
from zipline.testing.fixtures import (
WithAssetFinder,
WithTradingSessions,
Expand Down Expand Up @@ -645,6 +645,7 @@ class EventLoaderUtilsTestCase(ZiplineTestCase):
# Test with timezones on either side of the meridian
@parameterized.expand([(expected_us, 'US/Eastern', us_dates),
(expected_russia, 'Europe/Moscow', moscow_dates)])
@slow
def test_normalize_to_query_time(self, expected, tz, dates):
# Order matters in pandas 0.18.2. Prior to that, using tz_convert on
# a DatetimeIndex with DST/EST timestamps mixed resulted in some of
Expand Down
9 changes: 7 additions & 2 deletions tests/pipeline/test_quarters_estimates.py
Expand Up @@ -37,13 +37,17 @@
PreviousSplitAdjustedEarningsEstimatesLoader,
split_normalized_quarters,
)
from zipline.testing import slow
from zipline.testing.fixtures import (
WithAdjustmentReader,
WithTradingSessions,
ZiplineTestCase,
)
from zipline.testing.predicates import assert_equal, assert_raises_regex
from zipline.testing.predicates import assert_frame_equal
from zipline.testing.predicates import (
assert_equal,
assert_frame_equal,
assert_raises_regex,
)
from zipline.utils.numpy_utils import datetime64ns_dtype
from zipline.utils.numpy_utils import float64_dtype

Expand Down Expand Up @@ -581,6 +585,7 @@ def get_expected_estimate(self,
comparable_date):
return pd.DataFrame()

@slow
def test_estimates(self):
dataset = QuartersEstimates(1)
engine = SimplePipelineEngine(
Expand Down
1 change: 1 addition & 0 deletions zipline/testing/__init__.py
Expand Up @@ -40,6 +40,7 @@
read_compressed,
seconds_to_timestamp,
security_list_copy,
slow,
str_to_seconds,
subtest,
temp_pipeline_engine,
Expand Down
5 changes: 5 additions & 0 deletions zipline/testing/core.py
Expand Up @@ -17,6 +17,7 @@
from logbook import TestHandler
from mock import patch
from nose.tools import nottest
from nose.plugins.attrib import attr
from numpy.testing import assert_allclose, assert_array_equal
import pandas as pd
from six import itervalues, iteritems, with_metaclass
Expand Down Expand Up @@ -1573,3 +1574,7 @@ class OpenPrice(CustomFactor):

def compute(self, today, assets, out, open):
out[:] = open


# Marker for skipping slow tests.
slow = attr('slow')

0 comments on commit 74cfe8a

Please sign in to comment.