Merge pull request #1282 from quantopian/fix-data-tests-discovery

TST: fix bundle test discovery
This commit is contained in:
Lotanna Ezenwa
2016-07-25 18:36:38 -04:00
committed by GitHub
11 changed files with 113 additions and 53 deletions
View File
+1 -1
View File
@@ -303,7 +303,7 @@ class BundleCoreTestCase(WithInstanceTmpDir, ZiplineTestCase):
output_dir):
_wrote_to.append(output_dir)
_wrote_to.clear()
_wrote_to[:] = []
self.ingest('bundle', environ=self.environ)
assert_equal(len(_wrote_to), 1, msg='ingest was called more than once')
ingestions = self._list_bundle()
+9 -4
View File
@@ -1,3 +1,5 @@
from __future__ import division
import numpy as np
import pandas as pd
from six.moves.urllib.parse import urlparse, parse_qs
@@ -5,7 +7,7 @@ from toolz import flip, identity
from toolz.curried import merge_with, operator as op
from zipline.data.bundles.core import _make_bundle_core
from zipline.data.bundles import yahoo_equities, load
from zipline.data.bundles import yahoo_equities
from zipline.lib.adjustment import Float64Multiply
from zipline.testing import test_resource_path, tmp_dir, read_compressed
from zipline.testing.fixtures import WithResponses, ZiplineTestCase
@@ -30,7 +32,9 @@ class YahooBundleTestCase(WithResponses, ZiplineTestCase):
(cls.bundles,
cls.register,
cls.unregister,
cls.ingest) = map(staticmethod, _make_bundle_core())
cls.ingest,
cls.load,
cls.clean) = map(staticmethod, _make_bundle_core())
def _expected_data(self):
sids = 0, 1, 2
@@ -165,8 +169,8 @@ class YahooBundleTestCase(WithResponses, ZiplineTestCase):
'ZIPLINE_ROOT': zipline_root,
}
self.ingest('bundle', environ=environ)
bundle = load('bundle', environ=environ)
self.ingest('bundle', environ=environ, show_progress=False)
bundle = self.load('bundle', environ=environ)
sids = 0, 1, 2
equities = bundle.asset_finder.retrieve_all(sids)
@@ -199,4 +203,5 @@ class YahooBundleTestCase(WithResponses, ZiplineTestCase):
adjustments,
expected,
msg=column,
decimal=4,
)