summaryrefslogtreecommitdiff
path: root/src/buildstream/testing/_fixtures.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/testing/_fixtures.py')
-rw-r--r--src/buildstream/testing/_fixtures.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buildstream/testing/_fixtures.py b/src/buildstream/testing/_fixtures.py
index 862cebe87..2684782a1 100644
--- a/src/buildstream/testing/_fixtures.py
+++ b/src/buildstream/testing/_fixtures.py
@@ -17,7 +17,7 @@
import psutil
import pytest
-from buildstream import utils
+from buildstream import node, utils
# Catch tests that don't shut down background threads, which could then lead
# to other tests hanging when BuildStream uses fork().
@@ -29,3 +29,8 @@ def thread_check():
yield
assert utils._is_single_threaded()
+
+# Reset global state in node.pyx to improve test isolation
+@pytest.fixture(autouse=True)
+def reset_global_node_state():
+ node._reset_global_state()