File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed
Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff 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-
339327def test_threading ():
340328 import pandas as pd
341329 TEST_LEN_SHORT = 999
Original file line number Diff line number Diff 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+
3643def test_input_nans ():
3744 a1 = np .arange (10 , dtype = float )
3845 a2 = np .arange (10 , dtype = float )
You can’t perform that action at this time.
0 commit comments