Visitar URL original
Fix assertions in tests that were always `True` by namurphy · Pull Request #1634 · PlasmaPy/PlasmaPy · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions plasmapy/formulary/tests/test_dielectric.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ def test_known(self, kwargs, expected):
kwargs["kWave"] = kwargs["omega"] / vth

val = permittivity_1D_Maxwellian(**kwargs)
assert (
np.isclose(val, expected, rtol=1e-6, atol=0.0),
assert np.isclose(val, expected, rtol=1e-6, atol=0.0), (
f"Permittivity value should be {expected} and not {val}.",
)

Expand All @@ -189,8 +188,7 @@ def test_fail(self, kwargs, expected):
val = permittivity_1D_Maxwellian(**kwargs)

expected += 1e-15
assert (
not np.isclose(val, expected, rtol=1e-16, atol=0.0),
assert not np.isclose(val, expected, rtol=1e-16, atol=0.0), (
f"Permittivity value test gives {val} and should not be "
f"equal to {expected}.",
)
Expand Down Expand Up @@ -218,8 +216,7 @@ def test_normal_vs_lite_values(self, kwargs, expected):
wp.value,
)

assert (
np.isclose(val, val_lite, rtol=1e-6, atol=0.0),
assert np.isclose(val, val_lite, rtol=1e-6, atol=0.0), (
"'permittivity_1D_Maxwellian' and 'permittivity_1D_Maxwellian_lite' "
"do not agree.",
)