From 76e4334d647e4d20e939eb8fabcb218a43d05a75 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Mon, 14 Apr 2014 15:54:57 -0400 Subject: [PATCH] TST: Change cumulative risk test to use some style as rest of suite. Change the algorithm volatility test to use the same iterkv style as the rest of the suite, as it was useful to be able to zero in on the offending date when debugging changes to the risk module. --- tests/risk/test_risk_cumulative.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/risk/test_risk_cumulative.py b/tests/risk/test_risk_cumulative.py index 5ab1b843..6c5ebcec 100644 --- a/tests/risk/test_risk_cumulative.py +++ b/tests/risk/test_risk_cumulative.py @@ -59,9 +59,12 @@ class TestRisk(unittest.TestCase): returns['Benchmark Returns']) def test_algorithm_volatility_06(self): - np.testing.assert_almost_equal( - ANSWER_KEY.ALGORITHM_CUMULATIVE_VOLATILITY, - self.cumulative_metrics_06.metrics.algorithm_volatility.values) + algo_vol_answers = answer_key.RISK_CUMULATIVE.volatility + for dt, value in algo_vol_answers.iterkv(): + np.testing.assert_almost_equal( + self.cumulative_metrics_06.metrics.algorithm_volatility[dt], + value, + err_msg="Mismatch at %s" % (dt,)) def test_sharpe_06(self): for dt, value in answer_key.RISK_CUMULATIVE.sharpe.iterkv():