summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-09-03 19:38:14 +0200
committerbst-marge-bot <marge-bot@buildstream.build>2019-09-04 09:42:20 +0000
commita9364a40620e2ad2c299cdccee3d7da39fdd25b5 (patch)
treed973b942229e63202bc13bc2be016bb36e5328da
parentf8fe8245fabba9631a5c89e62a45b7a6bfc57cb4 (diff)
downloadbuildstream-a9364a40620e2ad2c299cdccee3d7da39fdd25b5.tar.gz
node.pyx: Add _reset_global_state() method
This will be used by the test suite to improve isolation between tests running in the same process.
-rw-r--r--src/buildstream/node.pyx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/buildstream/node.pyx b/src/buildstream/node.pyx
index 3fec1316d..b39d01db6 100644
--- a/src/buildstream/node.pyx
+++ b/src/buildstream/node.pyx
@@ -1584,6 +1584,18 @@ def _new_synthetic_file(str filename, object project=None):
return node
+# _reset_global_state()
+#
+# This resets the global variables __FILE_LIST and __counter to their initial
+# state. This is used by the test suite to improve isolation between tests
+# running in the same process.
+#
+def _reset_global_state():
+ global __FILE_LIST, __counter
+ __FILE_LIST = []
+ __counter = 0
+
+
#############################################################
# Module local helper Methods #
#############################################################