Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 19, 2024
1 parent 372cb0e commit fc72fd4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/logs/test_rp_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ def test_stacklevel_record_make(logger_handler):
else:
logger.error("test_log", exc_info=RuntimeError("test"), stack_info=inspect.stack(), stacklevel=2)
record = verify_record(logger_handler)
assert record.stack_info.endswith(
'logger.error("test_log", exc_info=RuntimeError("test"), stack_info=inspect.stack(), stacklevel=1)')
if sys.version_info < (3, 11):
assert record.stack_info.endswith(
'logger.error("test_log", exc_info=RuntimeError("test"), stack_info=inspect.stack(), stacklevel=1)')
else:
assert record.stack_info.endswith(
'logger.error("test_log", exc_info=RuntimeError("test"), stack_info=inspect.stack(), stacklevel=2)')

assert record.pathname == __file__

0 comments on commit fc72fd4

Please sign in to comment.