Skip to content

Commit

Permalink
modernize: no need to import object and int from builtins anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
aurzenligl committed Feb 19, 2024
1 parent d178456 commit 25211d8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pytest_logger/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import datetime
import argparse
import shutil
from builtins import object, int
from pathlib import Path


Expand Down Expand Up @@ -51,12 +50,12 @@ def pytest_configure(config):
config.pluginmanager.register(LoggerPlugin(config, early_logger._logcfg), '_logger')


class EarlyLoggerPlugin(object):
class EarlyLoggerPlugin:
def __init__(self, logcfg):
self._logcfg = logcfg


class LoggerPlugin(object):
class LoggerPlugin:
def __init__(self, config, logcfg):
self._config = config
self._logdirlinks = config.hook.pytest_logger_logdirlink(config=config)
Expand Down Expand Up @@ -119,7 +118,7 @@ def pytest_runtest_makereport(self, item, call):
logger.on_makereport()


class LoggerState(object):
class LoggerState:
def __init__(self, item, stdoutloggers, fileloggers, formatter):
self._put_newlines = bool(item.config.option.capture == 'no' and stdoutloggers)
self.handlers = _make_handlers(stdoutloggers, fileloggers, item, formatter)
Expand All @@ -142,7 +141,7 @@ def on_makereport(self):
_disable(self.handlers)


class RootEnabler(object):
class RootEnabler:
def __init__(self, enabled):
self._enabled = enabled
self._root_level = logging.root.level
Expand All @@ -157,7 +156,7 @@ def disable(self):
logging.root.setLevel(self._root_level)


class Loggers(object):
class Loggers:
def __init__(self, stdout, file_):
self.stdout = stdout
self.file = file_
Expand All @@ -166,7 +165,7 @@ def __bool__(self):
return bool(self.stdout) or bool(self.file)


class LoggerConfig(object):
class LoggerConfig:
"""Configuration of logging to stdout and filesystem."""

def __init__(self):
Expand Down Expand Up @@ -230,7 +229,7 @@ def split_by_outcome(self, outcomes=None, subdir='by_outcome'):
self._split_by_outcome_subdir = subdir


class LoggerHookspec(object):
class LoggerHookspec:
def pytest_logger_config(self, logger_config):
""" called before cmdline options parsing. Accepts terse configuration
of both stdout and file logging, adds cmdline options to manipulate
Expand Down

0 comments on commit 25211d8

Please sign in to comment.