summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-05 17:48:04 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 10:44:56 +0000
commitc1f48f47bcdbb610d90eccb4b8616a0a39b11bf3 (patch)
treeaf7b708f497058414fb414b1cbaded540e650ff0
parentd74774b22081011ee4912a087709e2115209c575 (diff)
downloadbuildstream-c1f48f47bcdbb610d90eccb4b8616a0a39b11bf3.tar.gz
tests/integration: Fix mutable default arguments
Python method default arguments should never be mutable. Using 'None' as a canary and setting them afterwards instead.
-rw-r--r--tests/integration/compose.py5
-rw-r--r--tests/integration/script.py8
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/integration/compose.py b/tests/integration/compose.py
index 33e763eb7..23b90a2df 100644
--- a/tests/integration/compose.py
+++ b/tests/integration/compose.py
@@ -20,7 +20,10 @@ DATA_DIR = os.path.join(
)
-def create_compose_element(name, path, config={}):
+def create_compose_element(name, path, config=None):
+ if config is None:
+ config = {}
+
element = {
'kind': 'compose',
'depends': [{
diff --git a/tests/integration/script.py b/tests/integration/script.py
index f0fe86593..cb95aae36 100644
--- a/tests/integration/script.py
+++ b/tests/integration/script.py
@@ -18,7 +18,13 @@ DATA_DIR = os.path.join(
)
-def create_script_element(name, path, config={}, variables={}):
+def create_script_element(name, path, config=None, variables=None):
+ if config is None:
+ config = {}
+
+ if variables is None:
+ variables = {}
+
element = {
'kind': 'script',
'depends': [{