From 553a46f2b41e0d9b55828353cb3295962ae8197b Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Thu, 19 Dec 2024 17:36:10 +0300 Subject: [PATCH] Fix tests --- tests/logs/test_rp_logger.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/logs/test_rp_logger.py b/tests/logs/test_rp_logger.py index f8f593c..6c369fb 100644 --- a/tests/logs/test_rp_logger.py +++ b/tests/logs/test_rp_logger.py @@ -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)')