Esempio n. 1
0
    def test_numpyarray_fails(self):
        with pytest.raises(ValueError):
            square(np.random.random((2,)))

        with pytest.raises(ValueError):
            square(np.random.random((2, 3)))

        with pytest.raises(ValueError):
            square(np.random.random((2, 3, 4)))
Esempio n. 2
0
    def test_list_fails(self):
        with pytest.raises(ValueError):
            square(np.random.random((2,)).tolist())

        with pytest.raises(ValueError):
            square(np.random.random((2, 3)).tolist())

        with pytest.raises(ValueError):
            square(np.random.random((2, 3, 4)).tolist())
Esempio n. 3
0
 def test_numpyarray_passes(self):
     square(np.random.random((3, 3)))
Esempio n. 4
0
 def test_list_passes(self):
     square(np.random.random((3, 3)).tolist())
Esempio n. 5
0
 def test_scalar_fails(self):
     with pytest.raises(ValueError):
         square(1)