Skip to content

Removed unreusable reusable code for better readability #3510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
23 changes: 0 additions & 23 deletions testsuite/pytests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def test_gsl():
pass
"""

import dataclasses
import os
import pathlib
import subprocess
Expand All @@ -45,7 +44,6 @@ def test_gsl():
# Ignore it during test collection
collect_ignore = ["utilities"]

import testsimulation # noqa
import testutil # noqa


Expand Down Expand Up @@ -174,24 +172,3 @@ def skipif_incompatible_mpi(request, subprocess_compatible_mpi):

if not subprocess_compatible_mpi and request.node.get_closest_marker("skipif_incompatible_mpi"):
pytest.skip("skipped because MPI is incompatible with subprocess")


@pytest.fixture(autouse=True)
def simulation_class(request):
return getattr(request, "param", testsimulation.Simulation)


@pytest.fixture
def simulation(request):
marker = request.node.get_closest_marker("simulation")
sim_cls = marker.args[0] if marker else testsimulation.Simulation
sim = sim_cls(*(request.getfixturevalue(field.name) for field in dataclasses.fields(sim_cls)))
nest.ResetKernel()
if getattr(sim, "set_resolution", True):
nest.resolution = sim.resolution
nest.local_num_threads = sim.local_num_threads
return sim


# Inject the root simulation fixtures into this module to be always available.
testutil.create_dataclass_fixtures(testsimulation.Simulation, __name__)
Loading
Loading