From f46fef1755cfdba452086f1c177d397f371688fb Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Mon, 6 Jul 2015 09:54:31 -0400 Subject: [PATCH] TST: Remove asset finder test for NASDAQ collisions. The asset finder retrieved from the test environment is empty, so the test does not end up testing anything, since the test cases loop over the empty list of sids in the asset finder. Remove to possibly be added back in and re-implemented after a larger refactoring of the module. --- tests/test_assets.py | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/tests/test_assets.py b/tests/test_assets.py index a034be05..e66c8331 100644 --- a/tests/test_assets.py +++ b/tests/test_assets.py @@ -25,14 +25,12 @@ from datetime import ( datetime ) import pickle -import pprint import uuid import warnings import pandas as pd from nose_parameterized import parameterized -from zipline.finance.trading import with_environment from zipline.assets import Asset, Equity, Future, AssetFinder from zipline.errors import ( SymbolNotFound, @@ -355,43 +353,6 @@ class AssetFinderTestCase(TestCase): self.assertEqual(result.symbol, 'existing') self.assertEqual(result.sid, i) - @with_environment() - def test_lookup_symbol_nasdaq_underscore_collisions(self, env=None): - """ - Ensure that each NASDAQ symbol without underscores maps back to the - original symbol when using fuzzy matching. - """ - sf = env.asset_finder - fuzzy_str = '_' - collisions = [] - - try: - for sid in sf.sids: - sec = sf.retrieve_asset(sid) - if sec.exchange.startswith('NASDAQ'): - found = sf.lookup_symbol(sec.symbol.replace(fuzzy_str, ''), - sec.end_date, fuzzy=fuzzy_str) - if found != sec: - collisions.append((found, sec)) - - # KNOWN BUG: Filter out assets that have intersections in their - # start and end dates. We can't correctly resolve these. - unexpected_errors = [] - for first, second in collisions: - overlapping_dates = ( - first.end_date >= second.start_date or - second.end_date >= first.end_date - ) - if not overlapping_dates: - unexpected_errors.append((first, second)) - - self.assertFalse( - unexpected_errors, - pprint.pformat(unexpected_errors), - ) - finally: - env.update_asset_finder(clear_metadata=True) - @parameterized.expand( build_lookup_generic_cases() )