Esempio n. 1
0
 def test_numpy_vector_fails_negative(self):
     with pytest.raises(ValueError):
         nonnegative((-1, -2, -3, -4))
Esempio n. 2
0
 def test_numpy_vector_passes(self):
     nonnegative((0, 0, 0, 0))
     nonnegative(np.asarray((1, 2, 3, 4)))
Esempio n. 3
0
 def test_list_fails_negative(self):
     with pytest.raises(ValueError):
         nonnegative((-1, -2, -3, -4))
Esempio n. 4
0
 def test_list_passes(self):
     nonnegative((0, 0, 0, 0))
     nonnegative((1, 2, 3, 4))
Esempio n. 5
0
 def test_scalar_fails_negative(self):
     with pytest.raises(ValueError):
         nonnegative(-4)
Esempio n. 6
0
 def test_scalar_passes(self):
     nonnegative(4)
     nonnegative(0)