chore: Exceptions in Obs.__init__ made more explicit.

This commit is contained in:
Fabian Joswig 2023-03-02 18:54:08 +00:00
parent dc7033e51f
commit 9ef7e504a0
No known key found for this signature in database
2 changed files with 16 additions and 16 deletions

View file

@ -25,23 +25,23 @@ def test_sin2_cos2(value):
def test_Obs_exceptions():
with pytest.raises(Exception):
with pytest.raises(ValueError):
pe.Obs([np.random.rand(10)], ['1', '2'])
with pytest.raises(Exception):
with pytest.raises(ValueError):
pe.Obs([np.random.rand(10)], ['1'], idl=[])
with pytest.raises(Exception):
with pytest.raises(ValueError):
pe.Obs([np.random.rand(10), np.random.rand(10)], ['1', '1'])
with pytest.raises(Exception):
with pytest.raises(TypeError):
pe.Obs([np.random.rand(10), np.random.rand(10)], ['1', 1])
with pytest.raises(Exception):
with pytest.raises(TypeError):
pe.Obs([np.random.rand(10)], [1])
with pytest.raises(Exception):
with pytest.raises(ValueError):
pe.Obs([np.random.rand(4)], ['name'])
with pytest.raises(Exception):
with pytest.raises(ValueError):
pe.Obs([np.random.rand(5)], ['1'], idl=[[5, 3, 2 ,4 ,1]])
with pytest.raises(Exception):
with pytest.raises(TypeError):
pe.Obs([np.random.rand(5)], ['1'], idl=['t'])
with pytest.raises(Exception):
with pytest.raises(ValueError):
pe.Obs([np.random.rand(5)], ['1'], idl=[range(1, 8)])
my_obs = pe.Obs([np.random.rand(6)], ['name'])