From 6e92b40ed9f1973c719669db10e8f92ce4877078 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Mon, 9 Jun 2014 17:37:26 -0400 Subject: [PATCH] MAINT/TEST: Move `to_utc` from `history_cases.py` to `test_utils.py`. --- tests/history_cases.py | 5 +---- zipline/utils/test_utils.py | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/history_cases.py b/tests/history_cases.py index 5f8f3dd2..0496ed5d 100644 --- a/tests/history_cases.py +++ b/tests/history_cases.py @@ -8,10 +8,7 @@ import numpy as np from zipline.finance.trading import TradingEnvironment from zipline.history.history import HistorySpec from zipline.protocol import BarData - - -def to_utc(time_str): - return pd.Timestamp(time_str, tz='US/Eastern').tz_convert('UTC') +from zipline.utils.test_utils import to_utc def mixed_frequency_expected_index(count, frequency): diff --git a/zipline/utils/test_utils.py b/zipline/utils/test_utils.py index e027b802..451590f7 100644 --- a/zipline/utils/test_utils.py +++ b/zipline/utils/test_utils.py @@ -4,6 +4,12 @@ from zipline.finance.blotter import ORDER_STATUS from six import itervalues +import pandas as pd + + +def to_utc(time_str): + return pd.Timestamp(time_str, tz='US/Eastern').tz_convert('UTC') + def setup_logger(test, path='test.log'): test.log_handler = FileHandler(path)