Skip to content

Commit 7ab0c23

Browse files
authored
Merge pull request #3661 from heplesser/helveg_3510
Simplify test implementation and remove complex reusable code for better readability (replacement for #3510)
2 parents b36b6a6 + d212c64 commit 7ab0c23

File tree

11 files changed

+949
-934
lines changed

11 files changed

+949
-934
lines changed

testsuite/pytests/conftest.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def test_gsl():
3131
pass
3232
"""
3333

34-
import dataclasses
3534
import os
3635
import pathlib
3736
import subprocess
@@ -45,7 +44,6 @@ def test_gsl():
4544
# Ignore it during test collection
4645
collect_ignore = ["utilities"]
4746

48-
import testsimulation # noqa
4947
import testutil # noqa
5048

5149

@@ -198,24 +196,3 @@ def skipif_incompatible_mpi(request, subprocess_compatible_mpi):
198196

199197
if not subprocess_compatible_mpi and request.node.get_closest_marker("skipif_incompatible_mpi"):
200198
pytest.skip("skipped because MPI is incompatible with subprocess")
201-
202-
203-
@pytest.fixture(autouse=True)
204-
def simulation_class(request):
205-
return getattr(request, "param", testsimulation.Simulation)
206-
207-
208-
@pytest.fixture
209-
def simulation(request):
210-
marker = request.node.get_closest_marker("simulation")
211-
sim_cls = marker.args[0] if marker else testsimulation.Simulation
212-
sim = sim_cls(*(request.getfixturevalue(field.name) for field in dataclasses.fields(sim_cls)))
213-
nest.ResetKernel()
214-
if getattr(sim, "set_resolution", True):
215-
nest.resolution = sim.resolution
216-
nest.local_num_threads = sim.local_num_threads
217-
return sim
218-
219-
220-
# Inject the root simulation fixtures into this module to be always available.
221-
testutil.create_dataclass_fixtures(testsimulation.Simulation, __name__)

0 commit comments

Comments
 (0)