summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-10 14:28:04 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-19 17:37:21 +0000
commit567298b39ccf078151ea2262b5cdba16b8ada524 (patch)
treea2238025529db7dcfb2377b6dbb3c9a0d4e44537
parentf8f5c8cb61ffb43046c448258bf064ab6d945ebd (diff)
downloadbuildstream-567298b39ccf078151ea2262b5cdba16b8ada524.tar.gz
tests:lint: don't use mutable default variables
-rw-r--r--tests/external_plugins.py5
-rw-r--r--tests/internals/yaml.py2
-rw-r--r--tests/sources/generic/track_cross_junction.py5
3 files changed, 9 insertions, 3 deletions
diff --git a/tests/external_plugins.py b/tests/external_plugins.py
index 961c3b5ec..c64f37c3d 100644
--- a/tests/external_plugins.py
+++ b/tests/external_plugins.py
@@ -19,11 +19,14 @@ import pytest
# used to specify a subset of test files from the repository to run.
# These must be specified relative to the root of the repository.
class ExternalPluginRepo():
- def __init__(self, name, url, ref, test_match_patterns=["tests"]):
+ def __init__(self, name, url, ref, test_match_patterns=None):
self.name = name
self.url = url
self.ref = ref
+ if test_match_patterns is None:
+ test_match_patterns = ["tests"]
+
self._test_match_patterns = test_match_patterns
self._clone_location = None
diff --git a/tests/internals/yaml.py b/tests/internals/yaml.py
index 218917667..5c1383a25 100644
--- a/tests/internals/yaml.py
+++ b/tests/internals/yaml.py
@@ -26,7 +26,7 @@ def test_load_yaml(datafiles):
assert loaded.get('kind') == 'pony'
-def assert_provenance(filename, line, col, node, key=None, indices=[]):
+def assert_provenance(filename, line, col, node, key=None, indices=None):
provenance = _yaml.node_get_provenance(node, key=key, indices=indices)
if key:
diff --git a/tests/sources/generic/track_cross_junction.py b/tests/sources/generic/track_cross_junction.py
index 6a2a8001f..94f718d43 100644
--- a/tests/sources/generic/track_cross_junction.py
+++ b/tests/sources/generic/track_cross_junction.py
@@ -59,7 +59,10 @@ def generate_import_element(tmpdir, kind, project, name):
return element_name
-def generate_project(tmpdir, name, config={}):
+def generate_project(tmpdir, name, config=None):
+ if config is None:
+ config = {}
+
project_name = 'project-{}'.format(name)
subproject_path = os.path.join(str(tmpdir.join(project_name)))
os.makedirs(os.path.join(subproject_path, 'elements'))