mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-27 11:20:45 +08:00
TST: Ensure holiday edge case is covered in dividend performance test.
Add a test suite of dividend performance that ensures a holiday is covered, needed because tests usually go over a random test range, so holiday coverage isn't covered in basic test. From @fawce.
This commit is contained in:
@@ -372,6 +372,23 @@ class TestDividendPerformance(unittest.TestCase):
|
||||
self.assertEqual(cumulative_cash_flows, [0, 0, 0, 0, 0])
|
||||
|
||||
|
||||
class TestDividendPerformanceHolidayStyle(TestDividendPerformance):
|
||||
|
||||
# The holiday tests begins the simulation on the day
|
||||
# before Thanksgiving, so that the next trading day is
|
||||
# two days ahead. Any tests that hard code events
|
||||
# to be start + oneday will fail, since those events will
|
||||
# be skipped by the simulation.
|
||||
|
||||
def setUp(self):
|
||||
self.dt = datetime.datetime(2003, 11, 30, tzinfo=pytz.utc)
|
||||
self.end_dt = datetime.datetime(2004, 11, 25, tzinfo=pytz.utc)
|
||||
self.sim_params = SimulationParameters(
|
||||
self.dt,
|
||||
self.end_dt)
|
||||
self.benchmark_events = benchmark_events_in_range(self.sim_params)
|
||||
|
||||
|
||||
class TestPositionPerformance(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user