Skip to content

Commit

Permalink
Fix dielectric tests that were always true (#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
namurphy committed Jul 16, 2022
1 parent 6e07601 commit 4342b08
Showing 1 changed file with 3 additions and 6 deletions.
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.",
)

0 comments on commit 4342b08

Please sign in to comment.