pytest: don't redirect stderr by default.

Some tests need to inspect it, but most don't, and I suspect I'm missing some
error messages due to this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-21 14:09:30 +09:30
committed by neil saitug
parent aaf743e438
commit 4cada557ba
6 changed files with 35 additions and 28 deletions

View File

@@ -109,7 +109,7 @@ def test_option_types(node_factory):
}, may_fail=True, start=False)
# the node should fail after start, and we get a stderr msg
n.daemon.start(wait_for_initialized=False)
n.daemon.start(wait_for_initialized=False, stderr_redir=True)
assert n.daemon.wait() == 1
wait_for(lambda: n.daemon.is_in_stderr('bool_opt: ! does not parse as type bool'))
@@ -122,7 +122,7 @@ def test_option_types(node_factory):
}, may_fail=True, start=False)
# the node should fail after start, and we get a stderr msg
n.daemon.start(wait_for_initialized=False)
n.daemon.start(wait_for_initialized=False, stderr_redir=True)
assert n.daemon.wait() == 1
assert n.daemon.is_in_stderr('--int_opt: notok does not parse as type int')
@@ -136,7 +136,7 @@ def test_option_types(node_factory):
}, may_fail=True, start=False)
# the node should fail after start, and we get a stderr msg
n.daemon.start(wait_for_initialized=False)
n.daemon.start(wait_for_initialized=False, stderr_redir=True)
assert n.daemon.wait() == 1
assert n.daemon.is_in_stderr("--flag_opt: doesn't allow an argument")
@@ -1522,7 +1522,7 @@ def test_libplugin(node_factory):
l1.stop()
l1.daemon.opts["name-deprecated"] = "test_opt"
l1.daemon.start(wait_for_initialized=False)
l1.daemon.start(wait_for_initialized=False, stderr_redir=True)
# Will exit with failure code.
assert l1.daemon.wait() == 1
assert l1.daemon.is_in_stderr(r"name-deprecated: deprecated option")
@@ -1669,7 +1669,7 @@ def test_bitcoin_backend(node_factory, bitcoind):
# We don't start if we haven't all the required methods registered.
plugin = os.path.join(os.getcwd(), "tests/plugins/bitcoin/part1.py")
l1.daemon.opts["plugin"] = plugin
l1.daemon.start(wait_for_initialized=False)
l1.daemon.start(wait_for_initialized=False, stderr_redir=True)
l1.daemon.wait_for_log("Missing a Bitcoin plugin command")
# Will exit with failure code.
assert l1.daemon.wait() == 1
@@ -2094,7 +2094,7 @@ def test_important_plugin(node_factory):
may_fail=True, expect_fail=True,
allow_broken_log=True, start=False)
n.daemon.start(wait_for_initialized=False)
n.daemon.start(wait_for_initialized=False, stderr_redir=True)
# Will exit with failure code.
assert n.daemon.wait() == 1
assert n.daemon.is_in_stderr(r"Failed to register .*nonexistent: No such file or directory")