Applied refactoring (#10991)
Removed default constructor and documentation for the internal class. Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
parent
8493a59c0f
commit
540eb6f08b
|
@ -1,2 +1 @@
|
||||||
Added handling of ``%f`` directive to print microseconds in log format options, such as ``log-date-format``.
|
Added handling of ``%f`` directive to print microseconds in log format options, such as ``log-date-format``.
|
||||||
Added helper :class:`pytest.logging.DatetimeFormatter <_pytest.logging.DatetimeFormatter>` which overrides :class:`logging.Formatter` behaviour to print log records with a microsecond-aware function :func:`datetime.strftime` instead of :func:`time.strftime`.
|
|
||||||
|
|
|
@ -63,8 +63,6 @@ class DatetimeFormatter(logging.Formatter):
|
||||||
:func:`time.strftime` in case of microseconds in format string.
|
:func:`time.strftime` in case of microseconds in format string.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs) -> None:
|
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
def formatTime(self, record: LogRecord, datefmt=None) -> str:
|
def formatTime(self, record: LogRecord, datefmt=None) -> str:
|
||||||
if datefmt and "%f" in datefmt:
|
if datefmt and "%f" in datefmt:
|
||||||
|
|
Loading…
Reference in New Issue