ignore directories and pyc files for changes (editors write tmp/swap

files etc., which also affects mtime of directory)
This commit is contained in:
holger krekel
2013-10-07 10:28:08 +02:00
parent 8e88261c15
commit ca54911481
3 changed files with 12 additions and 6 deletions

View File

@@ -1,7 +1,9 @@
1.10
-------------------------
- ignore dot files for file changes (editors write tmp/swap files etc.)
- ignore pyc files, dot files and directories for changes (editors write tmp/swap
files etc., which also affects mtime of directory)
1.9
-------------------------

View File

@@ -16,7 +16,7 @@ class TestStatRecorder:
(hello + "c").write("hello")
changed = sd.check()
assert changed
assert not changed
p = tmp.ensure("new.py")
changed = sd.check()
@@ -40,6 +40,12 @@ class TestStatRecorder:
changed = sd.check()
assert changed
def test_dirchange(self, tmpdir):
tmp = tmpdir
hello = tmp.ensure("dir", "hello.py")
sd = StatRecorder([tmp])
assert not sd.fil(tmp.join("dir"))
def test_filechange_deletion_race(self, tmpdir, monkeypatch):
tmp = tmpdir
sd = StatRecorder([tmp])
@@ -67,12 +73,10 @@ class TestStatRecorder:
pycfile = hello + "c"
pycfile.ensure()
changed = sd.check()
assert changed
hello.write("world")
changed = sd.check()
assert changed
assert not pycfile.check()
def test_waitonchange(self, tmpdir, monkeypatch):
tmp = tmpdir

View File

@@ -188,7 +188,7 @@ class StatRecorder:
self.check() # snapshot state
def fil(self, p):
return p.check(dotfile=0)
return p.check(file=1, dotfile=0) and p.ext != ".pyc"
def rec(self, p):
return p.check(dotfile=0)