TestCluster: add fixture to automatically reset
Since the test cluster is now a proper singleton, we have to reset it
before execution the test cases, which is done by this fixture.
@@ -17,6 +17,7 @@ import os
import pytest
import pynguin.configuration as config
+from pynguin.setup.testcluster import TestCluster
from pynguin.setup.testclustergenerator import TestClusterGenerator
from pynguin.typeinference.nonstrategy import NoTypeInferenceStrategy
from pynguin.typeinference.stubstrategy import StubInferenceStrategy
@@ -27,6 +28,11 @@ from tests.fixtures.cluster.no_dependencies import Test
from tests.fixtures.cluster.dependency import SomeArgumentType
+@pytest.fixture(autouse=True)
+def reset_test_cluster():
+ TestCluster._instance = None
+
+
def test_test_cluster_generator_accessible():
cluster = TestClusterGenerator(
"tests.fixtures.cluster.no_dependencies"
