diff options
author | James O'Beirne <james.obeirne@pm.me> | 2021-12-10 14:23:18 -0500 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2021-12-29 13:04:29 -0500 |
commit | a2fb62b632d39e468f59e7e0b6890f82d0f5eebb (patch) | |
tree | f58e9763b176696d44c91cf1ac9917c5ce7443ca /test | |
parent | 587cbca826d7331633a30b5a6cce170e3dbe2612 (diff) | |
download | bitcoin-a2fb62b632d39e468f59e7e0b6890f82d0f5eebb.tar.xz |
test: introduce TestNode.debug_log_bytes
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/test_framework/test_node.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index ca6e341be8..49d885f793 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -389,14 +389,17 @@ class TestNode(): def debug_log_path(self) -> Path: return self.chain_path / 'debug.log' + def debug_log_bytes(self) -> int: + with open(self.debug_log_path, encoding='utf-8') as dl: + dl.seek(0, 2) + return dl.tell() + @contextlib.contextmanager def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2): if unexpected_msgs is None: unexpected_msgs = [] time_end = time.time() + timeout * self.timeout_factor - with open(self.debug_log_path, encoding='utf-8') as dl: - dl.seek(0, 2) - prev_size = dl.tell() + prev_size = self.debug_log_bytes() yield |