Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_width_lifetime_conversions():
assert lifetime_to_width(1.5*ps)/GeV == approx(4.388079676311604e-13)
assert 1.5*ps * lifetime_to_width(1.5*ps) == hbar
assert width_to_lifetime(hbar) == 1 * MeV
#
with pytest.raises(ValueError):
lifetime_to_width(-1)
with pytest.raises(ValueError):
width_to_lifetime(-1)