Beispiel #1
0
 def test_numpy_vector_passes(self):
     negative(np.asarray((-1, -2, -3, -4)))
Beispiel #2
0
    def test_numpy_vector_fails(self):
        with pytest.raises(ValueError):
            negative((0, 0, 0, 0))

        with pytest.raises(ValueError):
            negative((1, 2, 3, 4))
Beispiel #3
0
    def test_tuple_fails(self):
        with pytest.raises(ValueError):
            negative((0, 0, 0, 0))

        with pytest.raises(ValueError):
            negative((1, 2, 3, 4))
Beispiel #4
0
 def test_tuple_passes(self):
     negative((-1, -2, -3, -4))
Beispiel #5
0
 def test_list_passes(self):
     negative([-1, -2, -3, -4])
Beispiel #6
0
 def test_scalar_fails(self):
     with pytest.raises(ValueError):
         negative(4)
     with pytest.raises(ValueError):
         negative(0)
Beispiel #7
0
 def test_scalar_passes(self):
     negative(-4)