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-20 09:38:42 +0000
commit254cc4d02451225b1a99fe31f923d3f9f79b0acb (patch)
tree8cf66607f600d4178a4b21ae8ff69b1f9f04e383
parentba62835edaa2af230122d9c104209085336b9fb2 (diff)
downloadbuildstream-254cc4d02451225b1a99fe31f923d3f9f79b0acb.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'))