From 16c488e5bcb455c795c3535c170b8ae798558a99 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Wed, 8 May 2013 08:31:08 -0400 Subject: [PATCH] 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. --- tests/test_risk_compare_batch_iterative.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_risk_compare_batch_iterative.py b/tests/test_risk_compare_batch_iterative.py index c12bc45b..1b6165be 100644 --- a/tests/test_risk_compare_batch_iterative.py +++ b/tests/test_risk_compare_batch_iterative.py @@ -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)