[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:
Fabian Joswig 2024-12-24 15:35:59 +01:00 committed by GitHub
parent d908508120
commit 3eac9214b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 143 additions and 143 deletions

View file

@ -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)