New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Don't require downloading of data for tests #1793

Merged
merged 3 commits into from May 18, 2017

Conversation

Projects
None yet
5 participants
@richafrank
Member

richafrank commented May 17, 2017

to avoid a new trading env needing to download data unnecessarily

@Peque

This comment has been minimized.

Contributor

Peque commented May 17, 2017

I have been getting those HTTP errors too, it seems ichart.finance.yahoo.com is down. They say they "will be right back..." though.

@freddiev4

This comment has been minimized.

Contributor

freddiev4 commented May 17, 2017

x-ref #1776

@coveralls

This comment has been minimized.

coveralls commented May 18, 2017

Coverage Status

Coverage decreased (-0.1%) to 87.591% when pulling c3ab3f9 on tests-without-yahoo into ca26208 on master.

TST: Use fixture's trading env for FakeDataPortal or TradingAlgo
to avoid a new trading env needing to download data unnecessarily

@richafrank richafrank force-pushed the tests-without-yahoo branch from c3ab3f9 to 6faf49d May 18, 2017

@richafrank richafrank changed the title from TST: Use fixture's trading env for FakeDataPortal to TST: Don't require downloading of data for tests May 18, 2017

@richafrank richafrank requested a review from ehebert May 18, 2017

@coveralls

This comment has been minimized.

coveralls commented May 18, 2017

Coverage Status

Coverage decreased (-0.1%) to 87.591% when pulling 6faf49d on tests-without-yahoo into ca26208 on master.

@richafrank richafrank requested a review from yankees714 May 18, 2017

@@ -872,8 +871,13 @@ class tmp_trading_env(tmp_asset_finder):
empty_trading_env
tmp_asset_finder
"""
def __init__(self, load=None, *args, **kwargs):

This comment has been minimized.

@yankees714

yankees714 May 18, 2017

Contributor

Should we update the docstring?

This comment has been minimized.

@richafrank
)
benchmark_returns = br[br.index.slice_indexer(first_date, last_date)]
treasury_curves = tc[tc.index.slice_indexer(first_date, last_date)]
return benchmark_returns, treasury_curves
def ensure_benchmark_data(symbol, first_date, last_date, now, trading_day):
def ensure_benchmark_data(symbol, first_date, last_date, now, trading_day,
environ=None):

This comment has been minimized.

@yankees714

yankees714 May 18, 2017

Contributor

Is the environ arg ever passed?

This comment has been minimized.

@richafrank

richafrank May 18, 2017

Member

Yea, the call site is here.

This comment has been minimized.

@yankees714

yankees714 May 18, 2017

Contributor

Ah, thanks!

first_trading_day=None):
if env is None:
env = TradingEnvironment()

This comment has been minimized.

@yankees714

yankees714 May 18, 2017

Contributor

👍

except OSError as e:
# be happy if someone already created the path
if e.errno != errno.EEXIST:
raise

This comment has been minimized.

@yankees714

yankees714 May 18, 2017

Contributor

Could this use zipline.utils.paths.ensure_directory?

This comment has been minimized.

@richafrank

richafrank May 18, 2017

Member

Oh good call.

richafrank added some commits May 17, 2017

TST: Use fixture's data with tmp_trading_env
instead of env needing to download it
TST: Use testing market data with run_algorithm
so env doesn't need to download it

@richafrank richafrank force-pushed the tests-without-yahoo branch from 6faf49d to 8734224 May 18, 2017

@yankees714

LGTM!

@coveralls

This comment has been minimized.

coveralls commented May 18, 2017

Coverage Status

Coverage decreased (-0.1%) to 87.594% when pulling 8734224 on tests-without-yahoo into ca26208 on master.

@richafrank richafrank merged commit be8ea7c into master May 18, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@richafrank richafrank deleted the tests-without-yahoo branch May 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment