mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: caplog not capturing logging statements in a test
Solution: Put the function execution in the `caplog` context
This commit is contained in:
parent
e163547a7e
commit
8f01e1c4e8
@ -156,8 +156,8 @@ def test_upsert_validator_show(caplog, ongoing_election, b, priv_validator_path,
|
||||
show_args = Namespace(action='show',
|
||||
election_id=election_id)
|
||||
|
||||
run_upsert_validator_show(show_args, b)
|
||||
|
||||
with caplog.at_level(logging.INFO):
|
||||
assert caplog.records.pop().msg == \
|
||||
f'public_key={public_key}\npower={power}\nnode_id={node_id}\nstatus={status}'
|
||||
run_upsert_validator_show(show_args, b)
|
||||
msg = caplog.records.pop().msg
|
||||
assert msg == f'public_key={public_key}\npower={power}\nnode_id={node_id}\nstatus={status}'
|
||||
print("I am here")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user