summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-09 11:00:08 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-20 09:38:42 +0000
commit43d6892908ac19dcc64e05203fe67a71b3d167bc (patch)
treed0ecab2bd52d139908fd43d43d19189e41e89478
parent7474ed1f38b7b750e1cd2b5ebbfe9fc0f3f3d364 (diff)
downloadbuildstream-43d6892908ac19dcc64e05203fe67a71b3d167bc.tar.gz
tests:lint: be explicit when not using a variable
Fix all pylint unused-variable issues
-rw-r--r--tests/frontend/cross_junction_workspace.py2
-rw-r--r--tests/frontend/workspace.py30
-rw-r--r--tests/sourcecache/staging.py1
-rw-r--r--tests/sources/generic/mirror.py4
-rw-r--r--tests/sources/generic/workspace.py4
5 files changed, 20 insertions, 21 deletions
diff --git a/tests/frontend/cross_junction_workspace.py b/tests/frontend/cross_junction_workspace.py
index 837a09f8a..d3422b150 100644
--- a/tests/frontend/cross_junction_workspace.py
+++ b/tests/frontend/cross_junction_workspace.py
@@ -64,7 +64,7 @@ def test_open_cross_junction(cli, tmpdir):
def test_list_cross_junction(cli, tmpdir):
- project, workspace = open_cross_junction(cli, tmpdir)
+ project, _ = open_cross_junction(cli, tmpdir)
element = 'sub.bst:data.bst'
diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py
index 374d62ae8..f1fa13df0 100644
--- a/tests/frontend/workspace.py
+++ b/tests/frontend/workspace.py
@@ -106,7 +106,7 @@ class WorkspaceCreator():
raise "terable error"
for suffix, kind in zip(suffixs, kinds):
- element_name, element_path, workspace_dir = \
+ element_name, _, workspace_dir = \
self.create_workspace_element(kind, track, suffix, workspace_dir_usr,
element_attrs)
element_tuples.append((element_name, workspace_dir))
@@ -154,7 +154,7 @@ 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 element_name, workspace_dir in element_tuples:
+ for _, workspace_dir in element_tuples:
filename = os.path.join(workspace_dir, 'usr', 'bin', 'hello')
assert os.path.exists(filename)
@@ -353,7 +353,7 @@ def test_open_force_open(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_open_force_different_workspace(cli, tmpdir, datafiles):
- element_name, project, workspace = open_workspace(cli, tmpdir, datafiles, 'git', False, "-alpha")
+ _, project, workspace = open_workspace(cli, tmpdir, datafiles, 'git', False, "-alpha")
# Assert the workspace dir exists
assert os.path.exists(workspace)
@@ -363,7 +363,7 @@ def test_open_force_different_workspace(cli, tmpdir, datafiles):
tmpdir = os.path.join(str(tmpdir), "-beta")
shutil.move(hello_path, hello1_path)
- element_name2, project2, workspace2 = open_workspace(cli, tmpdir, datafiles, 'git', False, "-beta")
+ element_name2, _, workspace2 = open_workspace(cli, tmpdir, datafiles, 'git', False, "-beta")
# Assert the workspace dir exists
assert os.path.exists(workspace2)
@@ -503,9 +503,9 @@ def test_close_multiple(cli, tmpdir, datafiles):
def test_close_all(cli, tmpdir, datafiles):
tmpdir_alpha = os.path.join(str(tmpdir), 'alpha')
tmpdir_beta = os.path.join(str(tmpdir), 'beta')
- alpha, project, workspace_alpha = open_workspace(
+ _, project, workspace_alpha = open_workspace(
cli, tmpdir_alpha, datafiles, 'git', False, suffix='-alpha')
- beta, project, workspace_beta = open_workspace(
+ _, project, workspace_beta = open_workspace(
cli, tmpdir_beta, datafiles, 'git', False, suffix='-beta')
# Close the workspaces
@@ -571,9 +571,9 @@ def test_reset_all(cli, tmpdir, datafiles):
# Open the workspaces
tmpdir_alpha = os.path.join(str(tmpdir), 'alpha')
tmpdir_beta = os.path.join(str(tmpdir), 'beta')
- alpha, project, workspace_alpha = open_workspace(
+ _, project, workspace_alpha = open_workspace(
cli, tmpdir_alpha, datafiles, 'git', False, suffix='-alpha')
- beta, project, workspace_beta = open_workspace(
+ _, project, workspace_beta = open_workspace(
cli, tmpdir_beta, datafiles, 'git', False, suffix='-beta')
# Modify workspaces
@@ -1145,7 +1145,7 @@ def test_external_open_other(cli, datafiles, tmpdir_factory):
tmpdir1 = tmpdir_factory.mktemp('')
tmpdir2 = tmpdir_factory.mktemp('')
# Making use of the assumption that it's the same project in both invocations of open_workspace
- alpha_element, project, alpha_workspace = open_workspace(cli, tmpdir1, datafiles, "git", False, suffix="-alpha")
+ _, project, alpha_workspace = open_workspace(cli, tmpdir1, datafiles, "git", False, suffix="-alpha")
beta_element, _, beta_workspace = open_workspace(cli, tmpdir2, datafiles, "git", False, suffix="-beta")
# Closing the other element first, because I'm too lazy to create an
@@ -1165,8 +1165,8 @@ def test_external_close_other(cli, datafiles, tmpdir_factory):
tmpdir1 = tmpdir_factory.mktemp('')
tmpdir2 = tmpdir_factory.mktemp('')
# Making use of the assumption that it's the same project in both invocations of open_workspace
- alpha_element, project, alpha_workspace = open_workspace(cli, tmpdir1, datafiles, "git", False, suffix="-alpha")
- beta_element, _, beta_workspace = open_workspace(cli, tmpdir2, datafiles, "git", False, suffix="-beta")
+ _, project, alpha_workspace = open_workspace(cli, tmpdir1, datafiles, "git", False, suffix="-alpha")
+ beta_element, _, _ = open_workspace(cli, tmpdir2, datafiles, "git", False, suffix="-beta")
result = cli.run(project=project, args=['-C', alpha_workspace, 'workspace', 'close', beta_element])
result.assert_success()
@@ -1181,7 +1181,7 @@ def test_external_close_self(cli, datafiles, tmpdir_factory, guess_element):
tmpdir2 = tmpdir_factory.mktemp('')
# Making use of the assumption that it's the same project in both invocations of open_workspace
alpha_element, project, alpha_workspace = open_workspace(cli, tmpdir1, datafiles, "git", False, suffix="-alpha")
- beta_element, _, beta_workspace = open_workspace(cli, tmpdir2, datafiles, "git", False, suffix="-beta")
+ _, _, _ = open_workspace(cli, tmpdir2, datafiles, "git", False, suffix="-beta")
arg_elm = [alpha_element] if not guess_element else []
result = cli.run(project=project, args=['-C', alpha_workspace, 'workspace', 'close', *arg_elm])
@@ -1194,8 +1194,8 @@ def test_external_reset_other(cli, datafiles, tmpdir_factory):
tmpdir1 = tmpdir_factory.mktemp('')
tmpdir2 = tmpdir_factory.mktemp('')
# Making use of the assumption that it's the same project in both invocations of open_workspace
- alpha_element, project, alpha_workspace = open_workspace(cli, tmpdir1, datafiles, "git", False, suffix="-alpha")
- beta_element, _, beta_workspace = open_workspace(cli, tmpdir2, datafiles, "git", False, suffix="-beta")
+ _, project, alpha_workspace = open_workspace(cli, tmpdir1, datafiles, "git", False, suffix="-alpha")
+ beta_element, _, _ = open_workspace(cli, tmpdir2, datafiles, "git", False, suffix="-beta")
result = cli.run(project=project, args=['-C', alpha_workspace, 'workspace', 'reset', beta_element])
result.assert_success()
@@ -1220,7 +1220,7 @@ def test_external_reset_self(cli, datafiles, tmpdir, guess_element):
def test_external_list(cli, datafiles, tmpdir_factory):
tmpdir = tmpdir_factory.mktemp('')
# Making use of the assumption that it's the same project in both invocations of open_workspace
- element, project, workspace = open_workspace(cli, tmpdir, datafiles, "git", False)
+ _, project, workspace = open_workspace(cli, tmpdir, datafiles, "git", False)
result = cli.run(project=project, args=['-C', workspace, 'workspace', 'list'])
result.assert_success()
diff --git a/tests/sourcecache/staging.py b/tests/sourcecache/staging.py
index b62bc3c2f..757839caa 100644
--- a/tests/sourcecache/staging.py
+++ b/tests/sourcecache/staging.py
@@ -147,7 +147,6 @@ def test_staged_source_build(tmpdir, datafiles, cli):
context.set_message_handler(dummy_message_handler)
element = project.load_elements(["import-dev.bst"])[0]
- source = list(element.sources())[0]
# check consistency of the source
assert not element._source_cached()
diff --git a/tests/sources/generic/mirror.py b/tests/sources/generic/mirror.py
index 63571234e..6bf3afef2 100644
--- a/tests/sources/generic/mirror.py
+++ b/tests/sources/generic/mirror.py
@@ -114,7 +114,7 @@ def test_mirror_fetch_upstream_absent(cli, tmpdir, datafiles, kind):
element_name = 'test.bst'
element_path = os.path.join(element_dir, element_name)
full_repo = element['sources'][0]['url']
- upstream_map, repo_name = os.path.split(full_repo)
+ _, repo_name = os.path.split(full_repo)
alias = 'foo-' + kind
aliased_repo = alias + ':' + repo_name
element['sources'][0]['url'] = aliased_repo
@@ -389,7 +389,7 @@ def test_mirror_track_upstream_absent(cli, tmpdir, datafiles, kind):
element_name = 'test.bst'
element_path = os.path.join(element_dir, element_name)
full_repo = element['sources'][0]['url']
- upstream_map, repo_name = os.path.split(full_repo)
+ _, repo_name = os.path.split(full_repo)
alias = 'foo-' + kind
aliased_repo = alias + ':' + repo_name
element['sources'][0]['url'] = aliased_repo
diff --git a/tests/sources/generic/workspace.py b/tests/sources/generic/workspace.py
index ee84676de..45e843317 100644
--- a/tests/sources/generic/workspace.py
+++ b/tests/sources/generic/workspace.py
@@ -88,7 +88,7 @@ class WorkspaceCreator():
raise "terable error"
for suffix, kind in zip(suffixs, kinds):
- element_name, element_path, workspace_dir = \
+ element_name, _, workspace_dir = \
self.create_workspace_element(kind, track, suffix, workspace_dir_usr,
element_attrs)
element_tuples.append((element_name, workspace_dir))
@@ -136,7 +136,7 @@ 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 element_name, workspace_dir in element_tuples:
+ for _, workspace_dir in element_tuples:
filename = os.path.join(workspace_dir, 'usr', 'bin', 'hello')
assert os.path.exists(filename)