Skip to content

Commit

Permalink
Bump to version 2.1.3 and cosmetic/formatting changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarpas committed Dec 22, 2024
1 parent 419eec1 commit cd109a2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
3 changes: 1 addition & 2 deletions testmon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
"""PYTEST_DONT_REWRITE"""

TESTMON_VERSION = "2.1.2"
TESTMON_VERSION = "2.1.3"
8 changes: 2 additions & 6 deletions testmon/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,


Expand Down
8 changes: 3 additions & 5 deletions testmon/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

Expand Down
1 change: 0 additions & 1 deletion testmon/pytest_testmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions testmon/testmon_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cd109a2

Please sign in to comment.