From d6d33c94751bd47ca77d2b2e4ac246a2dd1328a6 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Thu, 28 Feb 2019 19:31:03 +0000 Subject: tests: Remove unused variables --- tests/internals/pluginfactory.py | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'tests/internals/pluginfactory.py') 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') ############################################################## -- cgit v1.2.1