3838
3939from __future__ import annotations
4040import unittest
41+ import platform
4142from logging import getLogger , Formatter , lastResort , LogRecord
4243from firebird .base .types import *
4344from firebird .base .logging import logging_manager , get_logger , bind_logger , \
@@ -78,6 +79,10 @@ def test_module(self):
7879 self .assertIsNotNone (lastResort )
7980 self .assertIsNotNone (lastResort .formatter )
8081 def test_aaa (self ):
82+ if int (platform .python_version_tuple ()[1 ]) < 11 :
83+ AGENT = 'test_aaa (test_logging.TestLogging)'
84+ else :
85+ AGENT = 'test_aaa (test_logging.TestLogging.test_aaa)'
8186 # root
8287 with self .assertLogs () as log :
8388 get_logger (self ).info ('Message' )
@@ -89,7 +94,7 @@ def test_aaa(self):
8994 self .assertEqual (rec .filename , 'test_logging.py' )
9095 self .assertEqual (rec .funcName , 'test_aaa' )
9196 self .assertEqual (rec .topic , '' )
92- self .assertEqual (rec .agent , 'test_aaa (test_logging.TestLogging)' )
97+ self .assertEqual (rec .agent , AGENT )
9398 self .assertEqual (rec .context , UNDEFINED )
9499 self .assertEqual (rec .message , 'Message' )
95100 # trace
@@ -103,7 +108,7 @@ def test_aaa(self):
103108 self .assertEqual (rec .filename , 'test_logging.py' )
104109 self .assertEqual (rec .funcName , 'test_aaa' )
105110 self .assertEqual (rec .topic , 'trace' )
106- self .assertEqual (rec .agent , 'test_aaa (test_logging.TestLogging)' )
111+ self .assertEqual (rec .agent , AGENT )
107112 self .assertEqual (rec .context , UNDEFINED )
108113 self .assertEqual (rec .message , 'Message' )
109114 def test_interpolation (self ):
0 commit comments