mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
chore: Exceptions in Obs.__init__ made more explicit.
This commit is contained in:
parent
dc7033e51f
commit
9ef7e504a0
2 changed files with 16 additions and 16 deletions
|
@ -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'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue