summaryrefslogtreecommitdiff
path: root/tests/internals
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-02-28 19:31:03 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-01 19:05:30 +0000
commitd6d33c94751bd47ca77d2b2e4ac246a2dd1328a6 (patch)
tree1739ba821e90215f89901bed10326f4142360f21 /tests/internals
parent8f9b3dcdaca6f5179b79328b17b3e2c71db19e73 (diff)
downloadbuildstream-d6d33c94751bd47ca77d2b2e4ac246a2dd1328a6.tar.gz
tests: Remove unused variables
Diffstat (limited to 'tests/internals')
-rw-r--r--tests/internals/loader.py10
-rw-r--r--tests/internals/pluginfactory.py48
-rw-r--r--tests/internals/pluginloading.py4
-rw-r--r--tests/internals/yaml.py4
4 files changed, 33 insertions, 33 deletions
diff --git a/tests/internals/loader.py b/tests/internals/loader.py
index 87a5c3b35..a9727b680 100644
--- a/tests/internals/loader.py
+++ b/tests/internals/loader.py
@@ -46,7 +46,7 @@ def test_missing_file(datafiles):
loader = make_loader(basedir)
with pytest.raises(LoadError) as exc:
- element = loader.load(['elements/missing.bst'])[0]
+ loader.load(['elements/missing.bst'])[0]
assert (exc.value.reason == LoadErrorReason.MISSING_FILE)
@@ -58,7 +58,7 @@ def test_invalid_reference(datafiles):
loader = make_loader(basedir)
with pytest.raises(LoadError) as exc:
- element = loader.load(['elements/badreference.bst'])[0]
+ loader.load(['elements/badreference.bst'])[0]
assert (exc.value.reason == LoadErrorReason.INVALID_YAML)
@@ -70,7 +70,7 @@ def test_invalid_yaml(datafiles):
loader = make_loader(basedir)
with pytest.raises(LoadError) as exc:
- element = loader.load(['elements/badfile.bst'])[0]
+ loader.load(['elements/badfile.bst'])[0]
assert (exc.value.reason == LoadErrorReason.INVALID_YAML)
@@ -95,7 +95,7 @@ def test_invalid_key(datafiles):
loader = make_loader(basedir)
with pytest.raises(LoadError) as exc:
- element = loader.load(['elements/invalidkey.bst'])[0]
+ loader.load(['elements/invalidkey.bst'])[0]
assert (exc.value.reason == LoadErrorReason.INVALID_DATA)
@@ -107,6 +107,6 @@ def test_invalid_directory_load(datafiles):
loader = make_loader(basedir)
with pytest.raises(LoadError) as exc:
- element = loader.load(['elements/'])[0]
+ loader.load(['elements/'])[0]
assert (exc.value.reason == LoadErrorReason.LOADING_DIRECTORY)
diff --git a/tests/internals/pluginfactory.py b/tests/internals/pluginfactory.py
index 28ab039bd..ec4516736 100644
--- a/tests/internals/pluginfactory.py
+++ b/tests/internals/pluginfactory.py
@@ -79,8 +79,8 @@ def test_missing_source(plugin_fixture):
assert(isinstance(factory, SourceFactory))
# Test fails if PluginError is not raised
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
def test_missing_element(plugin_fixture):
@@ -88,8 +88,8 @@ def test_missing_element(plugin_fixture):
assert(isinstance(factory, ElementFactory))
# Test fails if PluginError is not raised
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin that returns a value instead of Source subclass
@@ -102,8 +102,8 @@ def test_source_notatype(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = SourceFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin that returns a value instead of Element subclass
@@ -116,8 +116,8 @@ def test_element_notatype(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = ElementFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin that returns a type
@@ -131,8 +131,8 @@ def test_source_wrongtype(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = SourceFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin that returns a type
@@ -146,8 +146,8 @@ def test_element_wrongtype(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = ElementFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin which fails to provide a setup() function
@@ -160,8 +160,8 @@ def test_source_missing_setup(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = SourceFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin which fails to provide a setup() function
@@ -174,8 +174,8 @@ def test_element_missing_setup(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = ElementFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin which provides a setup symbol
@@ -189,8 +189,8 @@ def test_source_bad_setup(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = SourceFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin which provides a setup symbol
@@ -204,8 +204,8 @@ def test_element_bad_setup(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = ElementFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin which requires an absurdly
@@ -219,8 +219,8 @@ def test_source_badversion(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = SourceFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
# Load a factory with a plugin which requires an absurdly
@@ -234,8 +234,8 @@ def test_element_badversion(plugin_fixture, datafiles):
'plugins': {'foo': 0}
}]
factory = ElementFactory(plugin_fixture['base'], plugin_origins=plugins)
- with pytest.raises(PluginError) as exc:
- foo_type = factory.lookup('foo')
+ with pytest.raises(PluginError):
+ factory.lookup('foo')
##############################################################
diff --git a/tests/internals/pluginloading.py b/tests/internals/pluginloading.py
index 607d253ee..e14071718 100644
--- a/tests/internals/pluginloading.py
+++ b/tests/internals/pluginloading.py
@@ -50,7 +50,7 @@ def test_badversionsource(datafiles, tmpdir):
basedir = os.path.join(datafiles.dirname, datafiles.basename)
with pytest.raises(LoadError) as exc:
- targets = create_pipeline(tmpdir, basedir, 'simple.bst')
+ create_pipeline(tmpdir, basedir, 'simple.bst')
assert exc.value.reason == LoadErrorReason.UNSUPPORTED_PLUGIN
@@ -60,6 +60,6 @@ def test_badversionelement(datafiles, tmpdir):
basedir = os.path.join(datafiles.dirname, datafiles.basename)
with pytest.raises(LoadError) as exc:
- targets = create_pipeline(tmpdir, basedir, 'simple.bst')
+ create_pipeline(tmpdir, basedir, 'simple.bst')
assert exc.value.reason == LoadErrorReason.UNSUPPORTED_PLUGIN
diff --git a/tests/internals/yaml.py b/tests/internals/yaml.py
index bc513deb4..b2d96256d 100644
--- a/tests/internals/yaml.py
+++ b/tests/internals/yaml.py
@@ -119,7 +119,7 @@ def test_node_get(datafiles):
extra = _yaml.node_get(base, Mapping, 'extra')
with pytest.raises(LoadError) as exc:
- wrong = _yaml.node_get(extra, Mapping, 'old')
+ _yaml.node_get(extra, Mapping, 'old')
assert (exc.value.reason == LoadErrorReason.INVALID_DATA)
@@ -409,5 +409,5 @@ def test_value_doesnt_match_expected(datafiles):
test_dict = _yaml.load(conf_file)
with pytest.raises(LoadError) as exc:
- user_config = _yaml.node_get(test_dict, int, "Test4")
+ _yaml.node_get(test_dict, int, "Test4")
assert exc.value.reason == LoadErrorReason.INVALID_DATA