Put test name info into motor log
This commit is contained in:
+3
-6
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user