MCPcopy
hub / github.com/quantopian/zipline / test_no_stock_dividends_allowed

Method test_no_stock_dividends_allowed

tests/test_benchmark.py:224–240  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

222 )
223
224 def test_no_stock_dividends_allowed(self):
225 # try to use sid(4) as benchmark, should blow up due to the presence
226 # of a stock dividend
227
228 with self.assertRaises(InvalidBenchmarkAsset) as exc:
229 BenchmarkSource(
230 self.asset_finder.retrieve_asset(4),
231 self.trading_calendar,
232 self.sim_params.sessions,
233 self.data_portal
234 )
235
236 self.assertEqual("Equity(4 [D]) cannot be used as the benchmark "
237 "because it has a stock dividend on 2006-03-16 "
238 "00:00:00. Choose another asset to use as the "
239 "benchmark.",
240 exc.exception.message)
241
242
243class BenchmarkSpecTestCase(WithTmpDir,

Callers

nothing calls this directly

Calls 2

BenchmarkSourceClass · 0.90
retrieve_assetMethod · 0.80

Tested by

no test coverage detected