diff --git a/CHANGELOG b/CHANGELOG index 8fad642..6144fd1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,9 @@ - fix duplicate reported test ids with --looponfailing (thanks Jeremy Thurgood) +- fix pytest issue41: re-run tests on all file changes, not just + randomly select ones like .py/.c. + 1.8 ------------------------- diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 34596ee..69f83f4 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -33,7 +33,7 @@ class TestDistribution: result = testdir.runpytest(p1, "-n1") assert result.ret == 1 result.stdout.fnmatch_lines([ - "E ImportError: No module named __import_of_missing_module", + "E ImportError: *__import_of_missing_module*", ]) def test_n2_import_error(self, testdir): @@ -69,7 +69,7 @@ class TestDistribution: result = testdir.runpytest(p1, '--tx=popen', '--tx=popen') assert result.ret == 1 result.stdout.fnmatch_lines([ - "E ImportError: No module named __import_of_missing_module", + "E ImportError: *__import_of_missing_module*", ]) def test_manytests_to_one_popen(self, testdir): diff --git a/testing/test_looponfail.py b/testing/test_looponfail.py index 1c86772..fe5f9fd 100644 --- a/testing/test_looponfail.py +++ b/testing/test_looponfail.py @@ -64,11 +64,11 @@ class TestStatRecorder: pycfile = hello + "c" pycfile.ensure() changed = sd.check() - assert not changed + assert changed hello.write("world") changed = sd.check() - assert not pycfile.check() + assert changed def test_waitonchange(self, tmpdir, monkeypatch): tmp = tmpdir diff --git a/xdist/looponfail.py b/xdist/looponfail.py index 8987040..1a8d9f2 100644 --- a/xdist/looponfail.py +++ b/xdist/looponfail.py @@ -188,7 +188,7 @@ class StatRecorder: self.check() # snapshot state def fil(self, p): - return p.ext in ('.py', '.txt', '.c', '.h') + return True # we are sensitive to all file changes since 1.9 def rec(self, p): return p.check(dotfile=0)