test: Fix “local variable 'e' is assigned to but never used”

flake8 F841 lints, as of flake8 3.6.0
This commit is contained in:
Ben Woosley 2019-01-24 21:16:35 -08:00 committed by MarcoFalke
parent 3f288a1c05
commit 68f546635d
2 changed files with 6 additions and 6 deletions

View File

@ -72,7 +72,7 @@ class AssumeValidTest(BitcoinTestFramework):
break break
try: try:
p2p_conn.send_message(msg_block(self.blocks[i])) p2p_conn.send_message(msg_block(self.blocks[i]))
except IOError as e: except IOError:
assert not p2p_conn.is_connected assert not p2p_conn.is_connected
break break

View File

@ -192,18 +192,18 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.setup_network() self.setup_network()
self.run_test() self.run_test()
success = TestStatus.PASSED success = TestStatus.PASSED
except JSONRPCException as e: except JSONRPCException:
self.log.exception("JSONRPC error") self.log.exception("JSONRPC error")
except SkipTest as e: except SkipTest as e:
self.log.warning("Test Skipped: %s" % e.message) self.log.warning("Test Skipped: %s" % e.message)
success = TestStatus.SKIPPED success = TestStatus.SKIPPED
except AssertionError as e: except AssertionError:
self.log.exception("Assertion failed") self.log.exception("Assertion failed")
except KeyError as e: except KeyError:
self.log.exception("Key error") self.log.exception("Key error")
except Exception as e: except Exception:
self.log.exception("Unexpected exception caught during testing") self.log.exception("Unexpected exception caught during testing")
except KeyboardInterrupt as e: except KeyboardInterrupt:
self.log.warning("Exiting after keyboard interrupt") self.log.warning("Exiting after keyboard interrupt")
if success == TestStatus.FAILED and self.options.pdbonfailure: if success == TestStatus.FAILED and self.options.pdbonfailure: