mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 13:25:43 +01:00
pytest: Use the file object and don't use print without line-endings
This commit is contained in:
parent
ae99e493b8
commit
90f74907f9
@ -164,8 +164,7 @@ def printCrashLog(node):
|
|||||||
errors, fname = getCrashLog(node)
|
errors, fname = getCrashLog(node)
|
||||||
if errors:
|
if errors:
|
||||||
print("-" * 10, "{} (last 50 lines)".format(fname), "-" * 10)
|
print("-" * 10, "{} (last 50 lines)".format(fname), "-" * 10)
|
||||||
for l in errors[-50:]:
|
print("".join(errors[-50:]))
|
||||||
print(l, end='')
|
|
||||||
print("-" * 80)
|
print("-" * 80)
|
||||||
return 1 if errors else 0
|
return 1 if errors else 0
|
||||||
|
|
||||||
|
@ -679,10 +679,9 @@ class NodeFactory(object):
|
|||||||
if fake_bitcoin_cli:
|
if fake_bitcoin_cli:
|
||||||
cli = os.path.join(lightning_dir, "fake-bitcoin-cli")
|
cli = os.path.join(lightning_dir, "fake-bitcoin-cli")
|
||||||
with open(cli, "w") as text_file:
|
with open(cli, "w") as text_file:
|
||||||
print("""#! /bin/sh
|
text_file.write('#! /bin/sh\n'
|
||||||
! [ -f bitcoin-cli-fail ] || exit `cat bitcoin-cli-fail`
|
'! [ -f bitcoin-cli-fail ] || exit `cat bitcoin-cli-fail`\n'
|
||||||
exec bitcoin-cli "$@"
|
'exec bitcoin-cli "$@"\n')
|
||||||
""", file=text_file)
|
|
||||||
os.chmod(cli, os.stat(cli).st_mode | stat.S_IEXEC)
|
os.chmod(cli, os.stat(cli).st_mode | stat.S_IEXEC)
|
||||||
daemon.opts['bitcoin-cli'] = cli
|
daemon.opts['bitcoin-cli'] = cli
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user