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.
This commit is contained in:
Eddie Hebert
2014-04-14 15:54:57 -04:00
parent 63e3aa4c1e
commit 76e4334d64
+6 -3
View File
@@ -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():