Skip to content

Commit

Permalink
v1.4.2 re #169 Basic windows fix without much testing so far. A prope…
Browse files Browse the repository at this point in the history
…r release for windows will follow.
  • Loading branch information
tarpas committed Nov 17, 2022
1 parent faa3854 commit 2a57e82
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pytest-testmon
version = 1.4.1
version = 1.4.2
license = AGPL
author_email = [email protected]
author = Tibor Arpas, Tomas Matlovic
Expand All @@ -13,7 +13,6 @@ project_urls =
platforms =
linux
osx
win32
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Developers
Expand Down
8 changes: 4 additions & 4 deletions testmon/pytest_testmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ def register_plugins(config, should_select, should_collect, cov_plugin):
def pytest_configure(config):
coverage_stack = None
try:
from tmnet.testmon_core import Testmon as UberTestmon
from tmnet.testmon_core import (
Testmon as UberTestmon,
)

coverage_stack = UberTestmon.coverage_stack
except ImportError:
Expand Down Expand Up @@ -336,7 +338,6 @@ def pytest_runtest_logreport(self, report):

def pytest_keyboard_interrupt(self, excinfo):
if self._host == "single":

nodes_files_lines = self.testmon.get_batch_coverage_data()

nodes_fingerprints = nofili2fingerprints(
Expand Down Expand Up @@ -369,7 +370,6 @@ def get_failing(all_nodes):


def sort_items_by_duration(items, avg_durations):

items.sort(key=lambda item: avg_durations[item.nodeid])
items.sort(key=lambda item: avg_durations[get_node_class_name(item.nodeid)])
items.sort(key=lambda item: avg_durations[get_node_module_name(item.nodeid)])
Expand All @@ -395,7 +395,7 @@ def pytest_ignore_collect(self, path, config):
return True
return None

@pytest.mark.trylast
@pytest.hookimpl(trylast=True)
def pytest_collection_modifyitems(self, session, config, items):
selected = []
deselected = []
Expand Down
9 changes: 6 additions & 3 deletions testmon/testmon_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import textwrap
from functools import lru_cache
from collections import defaultdict

import pkg_resources
import pytest
from coverage import Coverage, CoverageData
Expand All @@ -20,8 +21,8 @@
)
from testmon.process_code import Module

TEST_BATCH_SIZE = 100

TEST_BATCH_SIZE = 100

LIBRARIES_KEY = "/libraries_checksum_testmon_name"

Expand Down Expand Up @@ -340,7 +341,9 @@ class Testmon:

def __init__(self, rootdir="", testmon_labels=None, cov_plugin=None):
try:
from testmon.testmon_core import Testmon as UberTestmon
from testmon.testmon_core import (
Testmon as UberTestmon,
)

Testmon.coverage_stack = UberTestmon.coverage_stack
except ImportError:
Expand Down Expand Up @@ -488,7 +491,7 @@ def get_nodes_files_lines(self, dont_include):
for lineno, contexts in contexts_by_lineno.items():
for context in contexts:
nodes_files_lines.setdefault(context, {}).setdefault(
relfilename, set()
relfilename.replace(os.sep, "/"), set()
).add(lineno)
files_lines.setdefault(file, set()).add(lineno)
nodes_files_lines.pop(dont_include, None)
Expand Down

0 comments on commit 2a57e82

Please sign in to comment.