diff --git a/tests/calendars/test_trading_calendar.py b/tests/calendars/test_trading_calendar.py index 59e2c2058e..8b732a312d 100644 --- a/tests/calendars/test_trading_calendar.py +++ b/tests/calendars/test_trading_calendar.py @@ -34,6 +34,7 @@ InvalidCalendarName, ) +from zipline.testing import slow from zipline.testing.predicates import assert_equal from zipline.utils.calendars import ( deregister_calendar, @@ -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) @@ -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 @@ -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'), @@ -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 diff --git a/tests/pipeline/test_engine.py b/tests/pipeline/test_engine.py index b1e389200f..bdd3194ecb 100644 --- a/tests/pipeline/test_engine.py +++ b/tests/pipeline/test_engine.py @@ -75,6 +75,7 @@ OpenPrice, parameter_space, product_upper_triangle, + slow, ) from zipline.testing.fixtures import ( WithAdjustmentReader, @@ -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 diff --git a/tests/pipeline/test_events.py b/tests/pipeline/test_events.py index 4bf8dceef4..5decc601c0 100644 --- a/tests/pipeline/test_events.py +++ b/tests/pipeline/test_events.py @@ -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, @@ -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 diff --git a/tests/pipeline/test_quarters_estimates.py b/tests/pipeline/test_quarters_estimates.py index a26c4e7d77..919bcba679 100644 --- a/tests/pipeline/test_quarters_estimates.py +++ b/tests/pipeline/test_quarters_estimates.py @@ -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 @@ -581,6 +585,7 @@ def get_expected_estimate(self, comparable_date): return pd.DataFrame() + @slow def test_estimates(self): dataset = QuartersEstimates(1) engine = SimplePipelineEngine( diff --git a/zipline/testing/__init__.py b/zipline/testing/__init__.py index 3911aacfdc..6b9d51bf7c 100644 --- a/zipline/testing/__init__.py +++ b/zipline/testing/__init__.py @@ -40,6 +40,7 @@ read_compressed, seconds_to_timestamp, security_list_copy, + slow, str_to_seconds, subtest, temp_pipeline_engine, diff --git a/zipline/testing/core.py b/zipline/testing/core.py index d92e8b9382..879f9badef 100644 --- a/zipline/testing/core.py +++ b/zipline/testing/core.py @@ -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 @@ -1573,3 +1574,7 @@ class OpenPrice(CustomFactor): def compute(self, today, assets, out, open): out[:] = open + + +# Marker for skipping slow tests. +slow = attr('slow')