summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@darkstarsystems.com>2019-08-26 14:00:24 -0400
committerGary Oberbrunner <garyo@darkstarsystems.com>2019-08-26 14:00:24 -0400
commitba174fb967d155d02495e6657cfc64aa7b245198 (patch)
tree81e6562606205ef6804149acc3144971e03d74f7
parentb9b6d1560ba1786a4967848ecc4f68438888e9dc (diff)
downloadscons-git-feature/new-toolchain.tar.gz
Toolchain: fix flake8 errorsfeature/new-toolchain
-rw-r--r--src/engine/SCons/ToolchainDesign/Tool-test.py10
-rw-r--r--src/engine/SCons/ToolchainDesign/Tool.py6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/engine/SCons/ToolchainDesign/Tool-test.py b/src/engine/SCons/ToolchainDesign/Tool-test.py
index ba5d98072..c377545f6 100644
--- a/src/engine/SCons/ToolchainDesign/Tool-test.py
+++ b/src/engine/SCons/ToolchainDesign/Tool-test.py
@@ -52,18 +52,18 @@ class ToolTests(unittest.TestCase):
def test_lookup(self):
t1 = Tool.Tool.register('t1', MockTool, ('arg1'), kwarg1='kwval1')
assert t1 == Tool.Tool.lookup('t1')
- assert None == Tool.Tool.lookup('xyz')
+ assert Tool.Tool.lookup('xyz') is None
def test_no_name(self):
with self.assertRaises(Tool.ToolError):
t1 = Tool.Tool.register(None, MockTool)
with self.assertRaises(Tool.ToolError):
- t1 = Tool.Tool.register('', MockTool)
+ t1 = Tool.Tool.register('', MockTool) # noqa: F841
def test_name_mismatch(self):
with self.assertRaises(Tool.ToolError):
- t1 = Tool.Tool.register('t1', MockTool)
- t2 = Tool.Tool.register('t2', MockTool)
+ t1 = Tool.Tool.register('t1', MockTool) # noqa: F841
+ t2 = Tool.Tool.register('t2', MockTool) # noqa: F841
def test_generate(self):
t1 = Tool.Tool.register('t1', MockTool, ('arg1'), kwarg1='kwval1')
@@ -72,7 +72,7 @@ class ToolTests(unittest.TestCase):
assert t1.generate_called == 1
assert t1.exists_called == 1
- def test_generate(self):
+ def test_generate2(self):
t1 = Tool.Tool.register('t1', MockTool, ('arg1'), kwarg1='kwval1')
assert t1.exists()
t1.generate(None)
diff --git a/src/engine/SCons/ToolchainDesign/Tool.py b/src/engine/SCons/ToolchainDesign/Tool.py
index cb1919954..d2f7f24ad 100644
--- a/src/engine/SCons/ToolchainDesign/Tool.py
+++ b/src/engine/SCons/ToolchainDesign/Tool.py
@@ -32,12 +32,12 @@ class ToolRegistry(object):
log("registering %s, class %s, args %s, %s"%(name, toolclass, args, kwargs))
if not name:
- raise ToolError, "Trying to register tool with no name: class %s"%repr(toolclass)
+ raise ToolError("Trying to register tool with no name: class %s"%repr(toolclass))
key = (toolclass, args, hashabledict(kwargs))
t = self.tools.get(key)
if t and t.name != name:
- raise ToolError, "Found matching tool %s, but doesn't match name %s"%(t.name, name)
+ raise ToolError("Found matching tool %s, but doesn't match name %s"%(t.name, name))
if not t:
# create tool
@@ -114,4 +114,4 @@ class Tool(object):
"""Set up the env to use the tool.
Defines construction variables, sets paths, etc.
No return value."""
- raise ToolError, "Should never call base Tool.generate()"
+ raise ToolError("Should never call base Tool.generate()")