ignore directories and pyc files for changes (editors write tmp/swap
files etc., which also affects mtime of directory)
This commit is contained in:
@@ -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
|
||||
-------------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user