summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-10 16:20:40 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-20 09:38:42 +0000
commit973b779741e60291fd3a99b373998a79e51f1bb7 (patch)
tree6cbe6e2c82a222384e2498a5f52c6e640c5ba3ec
parent48456242b0a3067c0aa6a551c4a0c5972baf27c4 (diff)
downloadbuildstream-973b779741e60291fd3a99b373998a79e51f1bb7.tar.gz
tests:lint: rename variables shadowing others
-rw-r--r--tests/frontend/show.py6
-rw-r--r--tests/frontend/workspace.py4
-rw-r--r--tests/sources/generic/workspace.py4
-rw-r--r--tests/sources/zip.py4
-rw-r--r--tests/testutils/repo/zip.py4
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/frontend/show.py b/tests/frontend/show.py
index ddc971dc3..a98893e68 100644
--- a/tests/frontend/show.py
+++ b/tests/frontend/show.py
@@ -17,17 +17,17 @@ DATA_DIR = os.path.join(
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'project'))
-@pytest.mark.parametrize("target,format,expected", [
+@pytest.mark.parametrize("target,fmt,expected", [
('import-bin.bst', '%{name}', 'import-bin.bst'),
('import-bin.bst', '%{state}', 'buildable'),
('compose-all.bst', '%{state}', 'waiting')
])
-def test_show(cli, datafiles, target, format, expected):
+def test_show(cli, datafiles, target, fmt, expected):
project = os.path.join(datafiles.dirname, datafiles.basename)
result = cli.run(project=project, silent=True, args=[
'show',
'--deps', 'none',
- '--format', format,
+ '--format', fmt,
target])
result.assert_success()
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index 265545fc7..6fb997a23 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -154,8 +154,8 @@ class WorkspaceCreator():
assert not any(states[e] != 'buildable' for e, _ in element_tuples)
# Check that the executable hello file is found in each workspace
- for _, workspace_dir in element_tuples:
- filename = os.path.join(workspace_dir, 'usr', 'bin', 'hello')
+ for _, workspace in element_tuples:
+ filename = os.path.join(workspace, 'usr', 'bin', 'hello')
assert os.path.exists(filename)
return element_tuples
diff --git a/tests/sources/generic/workspace.py b/tests/sources/generic/workspace.py
index 45e843317..d332a6ef6 100644
--- a/tests/sources/generic/workspace.py
+++ b/tests/sources/generic/workspace.py
@@ -136,8 +136,8 @@ class WorkspaceCreator():
assert not any(states[e] != 'buildable' for e, _ in element_tuples)
# Check that the executable hello file is found in each workspace
- for _, workspace_dir in element_tuples:
- filename = os.path.join(workspace_dir, 'usr', 'bin', 'hello')
+ for _, workspace in element_tuples:
+ filename = os.path.join(workspace, 'usr', 'bin', 'hello')
assert os.path.exists(filename)
return element_tuples
diff --git a/tests/sources/zip.py b/tests/sources/zip.py
index 273c0c3a4..64ef61c21 100644
--- a/tests/sources/zip.py
+++ b/tests/sources/zip.py
@@ -18,12 +18,12 @@ DATA_DIR = os.path.join(
def _assemble_zip(workingdir, dstfile):
old_dir = os.getcwd()
os.chdir(workingdir)
- with zipfile.ZipFile(dstfile, "w") as zip:
+ with zipfile.ZipFile(dstfile, "w") as zipfp:
for root, dirs, files in os.walk('.'):
names = dirs + files
names = [os.path.join(root, name) for name in names]
for name in names:
- zip.write(name)
+ zipfp.write(name)
os.chdir(old_dir)
diff --git a/tests/testutils/repo/zip.py b/tests/testutils/repo/zip.py
index 32a46984e..8133f1236 100644
--- a/tests/testutils/repo/zip.py
+++ b/tests/testutils/repo/zip.py
@@ -13,13 +13,13 @@ class Zip(Repo):
old_dir = os.getcwd()
os.chdir(directory)
- with zipfile.ZipFile(archive, "w") as zip:
+ with zipfile.ZipFile(archive, "w") as zipfp:
for root, dirs, files in os.walk('.'):
names = dirs + files
names = [os.path.join(root, name) for name in names]
for name in names:
- zip.write(name)
+ zipfp.write(name)
os.chdir(old_dir)