diff --git a/testing/testing.py b/testing/testing.py index 552bc7988..eea78ba5c 100644 --- a/testing/testing.py +++ b/testing/testing.py @@ -695,7 +695,6 @@ def run_testfiles(filenames='all', verbosity=2, out=sys.stderr, **kwargs): resultclass=PyMOLTestResult, verbosity=int(verbosity)).run(suite) # Run pytest files if any - cmd.reinitialize() pytest_nfail = pytest.main(['-v', *map(str, pytest_files)]) if pytest_files else 0 while deferred_unlink: diff --git a/testing/tests/api/conftest.py b/testing/tests/api/conftest.py new file mode 100644 index 000000000..d4ba7f618 --- /dev/null +++ b/testing/tests/api/conftest.py @@ -0,0 +1,9 @@ +import pytest + +from pymol import cmd + + +@pytest.fixture(autouse=True) +def setup(): + cmd.reinitialize() + yield