mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
[Fix] Ruff rules and more precise Excpetion types (#248)
* [Fix] Fix test for membership should be 'not in' (E713) * [Fix] Fix module imported but unused (F401) * [Fix] More precise Exception types in dirac, obs and correlator
This commit is contained in:
parent
d908508120
commit
3eac9214b4
11 changed files with 143 additions and 143 deletions
|
@ -30,7 +30,7 @@ def test_grid_dirac():
|
|||
'SigmaYZ',
|
||||
'SigmaZT']:
|
||||
pe.dirac.Grid_gamma(gamma)
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(ValueError):
|
||||
pe.dirac.Grid_gamma('Not a gamma matrix')
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ def test_epsilon_tensor():
|
|||
(1, 1, 3) : 0.0}
|
||||
for key, value in check.items():
|
||||
assert pe.dirac.epsilon_tensor(*key) == value
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(ValueError):
|
||||
pe.dirac.epsilon_tensor(0, 1, 3)
|
||||
|
||||
|
||||
|
@ -59,5 +59,5 @@ def test_epsilon_tensor_rank4():
|
|||
(1, 2, 3, 1) : 0.0}
|
||||
for key, value in check.items():
|
||||
assert pe.dirac.epsilon_tensor_rank4(*key) == value
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(ValueError):
|
||||
pe.dirac.epsilon_tensor_rank4(0, 1, 3, 4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue