diff --git a/testmon/__init__.py b/testmon/__init__.py index 961bd7c..e06328b 100644 --- a/testmon/__init__.py +++ b/testmon/__init__.py @@ -1,3 +1,2 @@ """PYTEST_DONT_REWRITE""" - -TESTMON_VERSION = "2.1.2" +TESTMON_VERSION = "2.1.3" diff --git a/testmon/common.py b/testmon/common.py index 12da1f1..b551e65 100644 --- a/testmon/common.py +++ b/testmon/common.py @@ -31,12 +31,8 @@ def get_system_packages_raw(): class FileFp(TypedDict): filename: str method_checksums: List[int] = None - mtime: float = ( - None # optimization helper, not really a part of the data structure fundamentally - ) - fsha: int = ( - None # optimization helper, not really a part of the data structure fundamentally - ) + mtime: float = None # optimization helper, not really a part of the data structure fundamentally + fsha: int = None # optimization helper, not really a part of the data structure fundamentally fingerprint_id: int = None # optimization helper, diff --git a/testmon/configure.py b/testmon/configure.py index c7dc717..2288d5c 100644 --- a/testmon/configure.py +++ b/testmon/configure.py @@ -87,11 +87,9 @@ def _get_noselect_reasons(options): def _formulate_deactivation(what, reasons): if reasons: return [ - ( - f"{what} automatically deactivated because {reasons[0]}, " - if reasons[0] - else what + " deactivated, " - ) + f"{what} automatically deactivated because {reasons[0]}, " + if reasons[0] + else what + " deactivated, " ] return [] diff --git a/testmon/pytest_testmon.py b/testmon/pytest_testmon.py index 567fa51..481e070 100644 --- a/testmon/pytest_testmon.py +++ b/testmon/pytest_testmon.py @@ -238,7 +238,6 @@ def pytest_configure(config): ) config.testmon_config: TmConf = tm_conf if tm_conf.select or tm_conf.collect: - try: init_testmon_data(config) register_plugins(config, tm_conf.select, tm_conf.collect, cov_plugin) diff --git a/testmon/testmon_core.py b/testmon/testmon_core.py index 0169d7a..a97cd78 100644 --- a/testmon/testmon_core.py +++ b/testmon/testmon_core.py @@ -11,7 +11,10 @@ from typing import TypeVar -from pytest_cov.plugin import CovPlugin +try: + from pytest_cov.plugin import CovPlugin +except ImportError: + pass import pytest from coverage import Coverage, CoverageData @@ -420,7 +423,9 @@ def cached_relpath(path, basepath): class TestmonCollector: coverage_stack: [Coverage] = [] - def __init__(self, rootdir, testmon_labels=None, cov_plugin=None): + def __init__( + self, rootdir, testmon_labels=None, cov_plugin=None + ): # TODO remove cov_plugin try: from testmon.testmon_core import ( # pylint: disable=import-outside-toplevel Testmon as UberTestmon,