Skip to content

Commit

Permalink
WIP: skip pytest_ignore_collect with -k/-m
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Apr 14, 2019
1 parent 33e9ee3 commit 4cbc52f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions testmon/pytest_testmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ def __init__(self, config, testmon_data):
self.f_to_ignore = self.testmon_data.stable_files
if self.config.getoption('tlf'):
self.f_to_ignore -= self.testmon_data.f_last_failed
self.has_possibly_filtering_args = any(
x for x in config._origargs
if x in ("-k", "-m")
)

def test_should_run(self, nodeid):
if self.config.getoption('tlf'):
Expand Down Expand Up @@ -180,6 +184,8 @@ def pytest_report_header(self, config):
return active_message + "."

def pytest_ignore_collect(self, path, config):
if self.has_possibly_filtering_args:
return
strpath = os.path.relpath(path.strpath, config.rootdir.strpath)
if strpath in (self.f_to_ignore):
self.collection_ignored.update(self.testmon_data.f_tests[strpath])
Expand Down

0 comments on commit 4cbc52f

Please sign in to comment.