Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4ee637

Browse files
committed
Updates tests
1 parent c90b489 commit a4ee637

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

tests/test_abstract.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -324,18 +324,6 @@ def test_call_without_arguments():
324324
abstract.Function('SMA')(10)
325325

326326

327-
def test_call_first_exception():
328-
inputs = {'close': np.array([np.nan, np.nan, np.nan])}
329-
330-
with pytest.raises(Exception, match="inputs are all NaN"):
331-
abstract.SMA(inputs, timeperiod=2)
332-
333-
inputs = {'close': np.array([1.0, 2.0, 3.0])}
334-
335-
output = abstract.SMA(inputs, timeperiod=2)
336-
expected = np.array([np.nan, 1.5, 2.5])
337-
assert_array_equal(expected, output)
338-
339327
def test_threading():
340328
import pandas as pd
341329
TEST_LEN_SHORT = 999

tests/test_func.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ def test_input_lengths():
3333
func.BOP(a1, a1, a1, a2)
3434

3535

36+
def test_input_allnans():
37+
a = np.arange(20, dtype=float)
38+
a[:] = np.nan
39+
r = func.RSI(a)
40+
assert np.all(np.isnan(r))
41+
42+
3643
def test_input_nans():
3744
a1 = np.arange(10, dtype=float)
3845
a2 = np.arange(10, dtype=float)

0 commit comments

Comments
 (0)