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:
theirix 2023-05-30 14:31:36 +03:00 committed by GitHub
parent 8493a59c0f
commit 540eb6f08b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 3 deletions

View File

@ -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`.

View File

@ -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: