TST: Fix increment in risk test that drops leading values.

The leading date of the date range was never called with update,
because in the main loop the todays_date variable was
incremented before update was called.

Fix by moving the increment to the next trading day to after the
call to update.
This commit is contained in:
Eddie Hebert
2013-05-08 08:31:08 -04:00
parent 41f1200dbd
commit 16c488e5bc
+3 -3
View File
@@ -78,9 +78,6 @@ class RiskCompareIterativeToBatch(unittest.TestCase):
)
cur_returns.append(todays_return_obj)
# Move forward day counter to next trading day
todays_date = trading.environment.next_trading_day(todays_date)
try:
risk_metrics_original = risk.RiskMetricsBatch(
start_date=start_date,
@@ -103,6 +100,9 @@ class RiskCompareIterativeToBatch(unittest.TestCase):
ret,
self.all_benchmark_returns[todays_return_obj.date])
# Move forward day counter to next trading day
todays_date = trading.environment.next_trading_day(todays_date)
self.assertEqual(
risk_metrics_original.start_date,
risk_metrics_refactor.start_date)