diff --git a/tests/test_assets.py b/tests/test_assets.py index 007b6cf7..d746cb38 100644 --- a/tests/test_assets.py +++ b/tests/test_assets.py @@ -671,6 +671,16 @@ class AssetFinderTestCase(TestCase): actual_result = finder.lifetimes(dates) assert_frame_equal(actual_result, expected_result) + def test_sids(self): + # Ensure that the sids property of the AssetFinder is functioning + env = TradingEnvironment() + env.write_data(equities_identifiers=[1, 2, 3]) + sids = env.asset_finder.sids + self.assertEqual(3, len(sids)) + self.assertTrue(1 in sids) + self.assertTrue(2 in sids) + self.assertTrue(3 in sids) + class TestFutureChain(TestCase): diff --git a/zipline/assets/assets.py b/zipline/assets/assets.py index d53d1604..93dedd96 100644 --- a/zipline/assets/assets.py +++ b/zipline/assets/assets.py @@ -439,7 +439,7 @@ class AssetFinder(object): def sids(self): return tuple(map( itemgetter('sid'), - sa.select(self.asset_router.c.sid,).execute().fetchall(), + sa.select((self.asset_router.c.sid,)).execute().fetchall(), )) def _lookup_generic_scalar(self,