[py-svn] py-trunk commit 85626112b548: robustiy some randomly failing tests

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Dec 29 12:37:48 CET 2009


# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview/
# User holger krekel <holger at merlinux.eu>
# Date 1262086605 -3600
# Node ID 85626112b5485b6ed78f5ced1bc95a3be8b537c3
# Parent 42a36fa714e665d79b69aa9aa8165871b6f7af2d
robustiy some randomly failing tests

--- a/bin-for-dist/test_install.py
+++ b/bin-for-dist/test_install.py
@@ -147,7 +147,8 @@ def test_plugin_setuptools_entry_point_i
     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', 

--- a/py/impl/path/svnwc.py
+++ b/py/impl/path/svnwc.py
@@ -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):

--- a/testing/path/test_svnwc.py
+++ b/testing/path/test_svnwc.py
@@ -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")

--- a/testing/path/test_local.py
+++ b/testing/path/test_local.py
@@ -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



More information about the pytest-commit mailing list