Browse Source

Fix flake8 warnings

ppa-0.6.1
practicalswift 7 years ago
committed by Christian Decker
parent
commit
d2109bfe0c
  1. 2
      tests/benchmark.py
  2. 14
      tests/test_lightningd.py
  3. 4
      tests/utils.py

2
tests/benchmark.py

@ -36,7 +36,7 @@ def bitcoind():
try:
bitcoind.rpc.stop()
except:
except Exception:
bitcoind.proc.kill()
bitcoind.proc.wait()

14
tests/test_lightningd.py

@ -46,7 +46,7 @@ def setupBitcoind(directory):
try:
bitcoind.start()
except:
except Exception:
teardown_bitcoind()
raise
@ -86,7 +86,7 @@ def teardown_bitcoind():
global bitcoind
try:
bitcoind.rpc.stop()
except:
except Exception:
bitcoind.proc.kill()
bitcoind.proc.wait()
@ -154,7 +154,7 @@ class NodeFactory(object):
try:
node.daemon.start()
except:
except Exception:
node.daemon.stop()
raise
@ -173,12 +173,12 @@ class NodeFactory(object):
try:
# This also puts leaks in log.
leaks = self.nodes[i].rpc.dev_memleak()['leaks']
except:
except Exception:
pass
try:
self.nodes[i].stop()
except:
except Exception:
if expected_successes[i]:
unexpected_fail = True
@ -223,7 +223,7 @@ class BaseLightningDTests(unittest.TestCase):
crashlog = os.path.join(node.daemon.lightning_dir, 'crash.log')
with open(crashlog, 'r') as f:
return f.readlines(), crashlog
except:
except Exception:
return None, None
def printCrashLog(self, node):
@ -3691,7 +3691,7 @@ class LightningDTests(BaseLightningDTests):
.format(l1.daemon.lightning_dir),
'-J', '-o',
'sendpay']).decode('utf-8')
except:
except Exception:
pass
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")

4
tests/utils.py

@ -301,7 +301,7 @@ class LightningNode(object):
def call_connect():
try:
self.rpc.connect('127.0.0.1', remote_node.daemon.port, tx['hex'], async=False)
except:
except Exception:
pass
t = threading.Thread(target=call_connect)
t.daemon = True
@ -384,7 +384,7 @@ class LightningNode(object):
try:
# May fail if the process already died
self.rpc.stop()
except:
except Exception:
pass
rc = self.daemon.wait(timeout)

Loading…
Cancel
Save