Esempio n. 1
0
    def test_numpyarray_fails(self):
        with pytest.raises(ValueError):
            finite(np.asarray((np.inf, np.inf, np.inf, np.inf)))

        with pytest.raises(ValueError):
            finite(np.asarray((-np.inf, np.inf, -np.inf, np.inf)))
Esempio n. 2
0
 def test_numpyarray_passes(self):
     finite(np.asarray((1, 2, 3, 4)))
Esempio n. 3
0
    def test_list_fails(self):
        with pytest.raises(ValueError):
            finite([np.inf, np.inf, np.inf, np.inf])

        with pytest.raises(ValueError):
            finite([np.inf, -np.inf, np.inf, -np.inf])
Esempio n. 4
0
 def test_list_passes(self):
     finite([1, 2, 3, 4])
Esempio n. 5
0
    def test_scalar_failses(self):
        with pytest.raises(ValueError):
            finite(np.inf)

        with pytest.raises(ValueError):
            finite(-np.inf)
Esempio n. 6
0
 def test_scalar_pass(self):
     finite(4)
     finite(-4)