fix pytest issue41: re-run tests on all file changes, not just

randomly select ones like .py/.c.
This commit is contained in:
holger krekel
2013-09-05 14:21:43 +02:00
parent 013b2fc6bb
commit f144ef88e3
4 changed files with 8 additions and 5 deletions

View File

@@ -6,6 +6,9 @@
- fix duplicate reported test ids with --looponfailing - fix duplicate reported test ids with --looponfailing
(thanks Jeremy Thurgood) (thanks Jeremy Thurgood)
- fix pytest issue41: re-run tests on all file changes, not just
randomly select ones like .py/.c.
1.8 1.8
------------------------- -------------------------

View File

@@ -33,7 +33,7 @@ class TestDistribution:
result = testdir.runpytest(p1, "-n1") result = testdir.runpytest(p1, "-n1")
assert result.ret == 1 assert result.ret == 1
result.stdout.fnmatch_lines([ 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): def test_n2_import_error(self, testdir):
@@ -69,7 +69,7 @@ class TestDistribution:
result = testdir.runpytest(p1, '--tx=popen', '--tx=popen') result = testdir.runpytest(p1, '--tx=popen', '--tx=popen')
assert result.ret == 1 assert result.ret == 1
result.stdout.fnmatch_lines([ 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): def test_manytests_to_one_popen(self, testdir):

View File

@@ -64,11 +64,11 @@ class TestStatRecorder:
pycfile = hello + "c" pycfile = hello + "c"
pycfile.ensure() pycfile.ensure()
changed = sd.check() changed = sd.check()
assert not changed assert changed
hello.write("world") hello.write("world")
changed = sd.check() changed = sd.check()
assert not pycfile.check() assert changed
def test_waitonchange(self, tmpdir, monkeypatch): def test_waitonchange(self, tmpdir, monkeypatch):
tmp = tmpdir tmp = tmpdir

View File

@@ -188,7 +188,7 @@ class StatRecorder:
self.check() # snapshot state self.check() # snapshot state
def fil(self, p): 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): def rec(self, p):
return p.check(dotfile=0) return p.check(dotfile=0)