Skip to content

Commit f739773

Browse files
authored
Fix format of milliseconds in pytest output (#10836)
## Problem The timestamp prefix of pytest log lines contains milliseconds without leading zeros, so values of milliseconds less than 100 printed incorrectly. For example: ``` 2025-02-15 12:02:51.997 INFO [_internal.py:97] 127.0.0.1 - - ... 2025-02-15 12:02:52.4 INFO [_internal.py:97] 127.0.0.1 - - ... 2025-02-15 12:02:52.9 INFO [_internal.py:97] 127.0.0.1 - - ... 2025-02-15 12:02:52.23 INFO [_internal.py:97] 127.0.0.1 - - ... ``` ## Summary of changes Fix log_format for pytest so that milliseconds are printed with leading zeros.
1 parent 2dae061 commit f739773

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ markers =
1111
testpaths =
1212
test_runner
1313
minversion = 6.0
14-
log_format = %(asctime)s.%(msecs)-3d %(levelname)s [%(filename)s:%(lineno)d] %(message)s
14+
log_format = %(asctime)s.%(msecs)03d %(levelname)s [%(filename)s:%(lineno)d] %(message)s
1515
log_date_format = %Y-%m-%d %H:%M:%S
1616
log_cli = true
1717
timeout = 300

0 commit comments

Comments
 (0)