From 05bf71dc0a65e58b33eeff1ca6cc161f49f502cf Mon Sep 17 00:00:00 2001 From: Gus Gordon Date: Wed, 25 Apr 2018 17:18:25 -0400 Subject: [PATCH] TST Add test for inf Sharpe (#93) --- empyrical/tests/test_stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/empyrical/tests/test_stats.py b/empyrical/tests/test_stats.py index f11eb76..1b9f84b 100644 --- a/empyrical/tests/test_stats.py +++ b/empyrical/tests/test_stats.py @@ -353,7 +353,8 @@ def test_omega_returns(self, returns, required_return_less, (mixed_returns, 0.0, 1.7238613961706866), (mixed_returns, simple_benchmark, 0.34111411441060574), (positive_returns, 0.0, 52.915026221291804), - (negative_returns, 0.0, -24.406808633910085) + (negative_returns, 0.0, -24.406808633910085), + (flat_line_1, 0.0, np.inf), ]) def test_sharpe_ratio(self, returns, risk_free, expected): assert_almost_equal(