diff --git a/tests/test_algorithm.py b/tests/test_algorithm.py index 272d203b..2b765f28 100644 --- a/tests/test_algorithm.py +++ b/tests/test_algorithm.py @@ -23,6 +23,7 @@ from unittest import TestCase import numpy as np import pandas as pd +from zipline.assets import Equity, Future from zipline.utils.api_support import ZiplineAPI from zipline.utils.control_flow import nullctx from zipline.utils.test_utils import ( @@ -91,7 +92,6 @@ from zipline.sources import (SpecificEquityTrades, DataFrameSource, DataPanelSource, RandomWalkSource) -from zipline.assets import Equity from zipline.finance.execution import LimitOrder from zipline.finance.trading import SimulationParameters @@ -797,6 +797,11 @@ class TestTransformAlgorithm(TestCase): sim_params=self.sim_params, env=self.env, ) + + # Ensure that the environment's asset 0 is an Equity + asset_to_test = algo.sid(0) + self.assertIsInstance(asset_to_test, Equity) + algo.run(self.df) @parameterized.expand([ @@ -811,6 +816,11 @@ class TestTransformAlgorithm(TestCase): sim_params=self.sim_params, env=self.futures_env, ) + + # Ensure that the environment's asset 0 is a Future + asset_to_test = algo.sid(0) + self.assertIsInstance(asset_to_test, Future) + algo.run(self.df) def test_order_method_style_forwarding(self):