robustiy some randomly failing tests

--HG--
branch : trunk
This commit is contained in:
holger krekel 2009-12-29 12:36:45 +01:00
parent 425e4849f3
commit 71e332c9c4
4 changed files with 6 additions and 3 deletions

View File

@ -147,7 +147,8 @@ def test_plugin_setuptools_entry_point_integration(py_setup, venv, tmpdir):
out = venv.pytest_getouterr("-h")
assert "testpluginopt" in out
def test_cmdline_entrypoints():
def test_cmdline_entrypoints(monkeypatch):
monkeypatch.syspath_prepend(py.path.local(__file__).dirpath().dirpath())
from setup import cmdline_entrypoints
versioned_scripts = ['py.test', 'py.which']
unversioned_scripts = versioned_scripts + [ 'py.cleanup',

View File

@ -429,6 +429,7 @@ class SvnWCCommandPath(common.PathBase):
return self
strpath = property(lambda x: str(x.localpath), None, None, "string path")
rev = property(lambda x: x.info(usecache=0).rev, None, None, "revision")
def __eq__(self, other):
return self.localpath == getattr(other, 'localpath', None)
@ -796,7 +797,6 @@ recursively. """
raise py.error.ENOENT(self, "not a versioned resource:" +
" %s != %s" % (info.path, self.localpath))
cache.info[self] = info
self.rev = info.rev
return info
def listdir(self, fil=None, sort=None):

View File

@ -499,7 +499,9 @@ class TestPOSIXLocalPath:
# we could wait here but timer resolution is very
# system dependent
path.read()
time.sleep(0.01)
atime2 = path.atime()
time.sleep(0.01)
duration = time.time() - now
assert (atime2-atime1) <= duration

View File

@ -12,7 +12,7 @@ def test_make_repo(path1, tmpdir):
repo = py.path.svnurl("file://%s" % repo)
wc = py.path.svnwc(tmpdir.join("wc"))
wc.checkout(repo)
assert wc.info().rev == 0
assert wc.rev == 0
assert len(wc.listdir()) == 0
p = wc.join("a_file")
p.write("test file")