Skip to content
Snippets Groups Projects
Commit a5be0952 authored by patavirt's avatar patavirt
Browse files

tests: fixup

parent 4ac3df07
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,19 @@ def test_result_S_J0(omega, h, terminals):
assert_allclose(J, 0, atol=1e-5)
def test_gauge_invariance():
@pytest.mark.parametrize(
"use_numdifftools",
[
False,
pytest.param(
True,
marks=pytest.mark.skipif(
numdifftools is None, reason="numdifftools not installed"
),
),
],
)
def test_gauge_invariance(use_numdifftools):
nx = 10
ny = 7
h = 0.4
......@@ -179,7 +191,7 @@ def test_gauge_invariance():
# They must match
assert_allclose(div_J, dS_ds, rtol=1e-6)
if numdifftools is not None:
if use_numdifftools:
# More accurate numdiff: the equality should hold to high
# numerical accuracy
D = numdifftools.Derivative(S_s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment