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 fc72fd4 commit 553a46f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/logs/test_rp_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ def test_log_level_filter(handler_level, log_level, expected_calls):
@mock.patch("reportportal_client.logs.logging.Logger.handle")
def test_stacklevel_record_make(logger_handler):
logger = RPLogger("test_logger")

if sys.version_info < (3, 11):
logger.error("test_log", exc_info=RuntimeError("test"), stack_info=inspect.stack(), stacklevel=1)
else:
logger.error("test_log", exc_info=RuntimeError("test"), stack_info=inspect.stack(), stacklevel=2)

record = verify_record(logger_handler)

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)')
Expand Down

0 comments on commit 553a46f

Please sign in to comment.