mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-12 21:03:44 +08:00
TST: overwrite_sim_params=False in tests when using list of sources
When specifying a list of sources to algorithm.py:run in a unit test, specify overwrite_sim_params=False to suppress the unnessary UserWarning.
This commit is contained in:
@@ -331,7 +331,7 @@ class TestTransformAlgorithm(TestCase):
|
||||
sim_params=sim_params,
|
||||
sids=[0, 1, 133]
|
||||
)
|
||||
algo.run([self.source, self.df_source])
|
||||
algo.run([self.source, self.df_source], overwrite_sim_params=False)
|
||||
self.assertEqual(len(algo.sources), 2)
|
||||
|
||||
def test_df_as_input(self):
|
||||
|
||||
@@ -226,5 +226,5 @@ class AlgorithmGeneratorTestCase(TestCase):
|
||||
sim_params = create_simulation_parameters(num_days=1,
|
||||
data_frequency='minute')
|
||||
algo = TestAlgo(self, sim_params=sim_params)
|
||||
algo.run(source=[])
|
||||
algo.run(source=[], overwrite_sim_params=False)
|
||||
self.assertEqual(algo.datetime, sim_params.last_close)
|
||||
|
||||
@@ -57,7 +57,7 @@ class TestTradeSimulation(TestCase):
|
||||
emission_rate=emission_rate)
|
||||
|
||||
algo = BeforeTradingAlgorithm(sim_params=params)
|
||||
algo.run(source=[])
|
||||
algo.run(source=[], overwrite_sim_params=False)
|
||||
|
||||
self.assertEqual(algo.perf_tracker.day_count, num_days)
|
||||
self.assertTrue(params.trading_days.equals(
|
||||
|
||||
Reference in New Issue
Block a user