improvements to rewrite cache invalidation
- stat the source path before it is read. - Validate the source size in addition to mtime.
This commit is contained in:
@@ -511,13 +511,13 @@ class TestAssertionRewriteHookDetails(object):
|
||||
state = AssertionState(config, "rewrite")
|
||||
source_path = tmpdir.ensure("source.py")
|
||||
pycpath = tmpdir.join("pyc").strpath
|
||||
assert _write_pyc(state, [1], source_path, pycpath)
|
||||
assert _write_pyc(state, [1], source_path.stat(), pycpath)
|
||||
def open(*args):
|
||||
e = IOError()
|
||||
e.errno = 10
|
||||
raise e
|
||||
monkeypatch.setattr(b, "open", open)
|
||||
assert not _write_pyc(state, [1], source_path, pycpath)
|
||||
assert not _write_pyc(state, [1], source_path.stat(), pycpath)
|
||||
|
||||
def test_resources_provider_for_loader(self, testdir):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user