Put test name info into motor log

This commit is contained in:
2025-12-05 16:29:33 +01:00
parent 61db329d85
commit 1f3d4438e3
+3 -6
View File
@@ -91,15 +91,12 @@ def configure_motor_logging(request):
logger.handlers.clear()
logger.setLevel(level)
# Level of the pytest logger
logger = logging.getLogger("pytest")
logger.setLevel(level)
def pytest_runtest_logreport(report: TestReport):
"""
Print the start of a test if the log level of the motor is INFO or lower.
"""
loglevel = logging.getLogger("pytest").getEffectiveLevel()
logger = logging.getLogger("motor")
loglevel = logger.getEffectiveLevel()
if loglevel <= logging.INFO and report.when == 'call':
print(f"\nRunning test: {report.nodeid}")
logger.info(f"Running test: {report.nodeid}")