Skip to content

Commit 4b57c09

Browse files
authored
refactor n_threads fixtures (#574)
1 parent 367a1b3 commit 4b57c09

File tree

7 files changed

+4
-20
lines changed

7 files changed

+4
-20
lines changed

tests/smoke_tests/timing/fixtures.py renamed to tests/smoke_tests/timing/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
pass
1515

1616

17-
@pytest.fixture(params=__num_threads)
18-
def num_threads(request):
17+
@pytest.fixture(params=__num_threads, name="num_threads")
18+
def num_threads_fixture(request):
1919
"""pytest fixture providing thread-pool size for tests: single-thread case
2020
for setups in which Numba reports no parallel support, and single-
2121
as well as multi-threaded test runs otherwise. For the multi-threaded

tests/smoke_tests/timing/test_timing_2d.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
from PyMPDATA import Options, ScalarField, Solver, Stepper, VectorField
88
from PyMPDATA.boundary_conditions import Periodic
99

10-
from .fixtures import num_threads
11-
12-
assert hasattr(num_threads, "_pytestfixturefunction")
13-
14-
1510
GRID = (126, 101)
1611

1712
TIMESTEP = 0.1

tests/smoke_tests/timing/test_timing_3d.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
from PyMPDATA import Options
88

9-
from .fixtures import num_threads
10-
11-
assert hasattr(num_threads, "_pytestfixturefunction")
12-
139

1410
@pytest.mark.parametrize(
1511
"options",

tests/unit_tests/fixtures/n_threads.py renamed to tests/unit_tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
__n_threads = (1,)
1010

1111

12-
@pytest.fixture(params=__n_threads)
13-
def n_threads(request):
12+
@pytest.fixture(params=__n_threads, name="n_threads")
13+
def n_threads_fixture(request):
1414
return request.param

tests/unit_tests/fixtures/__init__.py

Whitespace-only changes.

tests/unit_tests/test_traversals.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
)
2424
from PyMPDATA.impl.meta import META_HALO_VALID
2525
from PyMPDATA.impl.traversals import Traversals
26-
from tests.unit_tests.fixtures.n_threads import n_threads
27-
28-
assert hasattr(n_threads, "_pytestfixturefunction")
2926

3027
jit_flags = Options().jit_flags
3128

tests/unit_tests/test_traversals_with_bc_periodic.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
from PyMPDATA.boundary_conditions import Periodic
1111
from PyMPDATA.impl.enumerations import INNER, MAX_DIM_NUM, MID3D, OUTER
1212
from PyMPDATA.impl.traversals import Traversals
13-
from tests.unit_tests.fixtures.n_threads import n_threads
14-
15-
assert hasattr(n_threads, "_pytestfixturefunction")
16-
1713

1814
LEFT, RIGHT = "left", "right"
1915
ALL = (None, None)

0 commit comments

Comments
 (0)