Skip to content

Commit a2fb62b

Browse files
committed
test: introduce TestNode.debug_log_bytes
1 parent 587cbca commit a2fb62b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/test_framework/test_node.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,17 @@ def chain_path(self) -> Path:
389389
def debug_log_path(self) -> Path:
390390
return self.chain_path / 'debug.log'
391391

392+
def debug_log_bytes(self) -> int:
393+
with open(self.debug_log_path, encoding='utf-8') as dl:
394+
dl.seek(0, 2)
395+
return dl.tell()
396+
392397
@contextlib.contextmanager
393398
def assert_debug_log(self, expected_msgs, unexpected_msgs=None, timeout=2):
394399
if unexpected_msgs is None:
395400
unexpected_msgs = []
396401
time_end = time.time() + timeout * self.timeout_factor
397-
with open(self.debug_log_path, encoding='utf-8') as dl:
398-
dl.seek(0, 2)
399-
prev_size = dl.tell()
402+
prev_size = self.debug_log_bytes()
400403

401404
yield
402405

0 commit comments

Comments
 (0)