[py-svn] py-trunk commit 1a34c06b5a81: streamline svn test setup a bit, clear caches on setup-restore, hopefully will erase random failures with test_export.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Dec 30 13:05:40 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 1262174708 -3600
# Node ID 1a34c06b5a815ae8130432b6df09f765d6328fcd
# Parent 217b2f0523c0e1567529ba66d6cd27456b2dd6bf
streamline svn test setup a bit, clear caches on setup-restore, hopefully will erase random failures with test_export.
--- a/testing/path/common.py
+++ b/testing/path/common.py
@@ -378,7 +378,7 @@ class CommonFSTests(object):
newp.move(p)
assert p.check()
- def test_move_directory(self, path1):
+ def test_move_dir(self, path1):
source = path1.join('sampledir')
dest = path1.join('moveddir')
source.move(dest)
--- a/testing/path/test_svnurl.py
+++ b/testing/path/test_svnurl.py
@@ -13,22 +13,6 @@ class TestSvnURLCommandPath(CommonSvnTes
def test_load(self, path1):
super(TestSvnURLCommandPath, self).test_load(path1)
- def test_move_file(self, path1): # overrides base class
- p = path1.ensure('origfile')
- newp = p.dirpath('newfile')
- p.move(newp)
- assert newp.check(file=1)
- newp.remove()
- assert not p.check()
-
- def test_move_dir(self, path1): # overrides base class
- p = path1.ensure('origdir', dir=1)
- newp = p.dirpath('newdir')
- p.move(newp)
- assert newp.check(dir=1)
- newp.remove()
- assert not p.check()
-
def test_svnurl_needs_arg(self, path1):
py.test.raises(TypeError, "py.path.svnurl()")
--- a/testing/path/test_cacheutil.py
+++ b/testing/path/test_cacheutil.py
@@ -22,6 +22,9 @@ class BasicCacheAPITest:
self.cache.delentry(100)
py.test.raises(KeyError, "self.cache.delentry(100, raising=True)")
+ def test_clear(self):
+ self.cache.clear()
+
class TestBuildcostAccess(BasicCacheAPITest):
cache = cacheutil.BuildcostAccessCache(maxentries=128)
--- a/testing/path/test_svnwc.py
+++ b/testing/path/test_svnwc.py
@@ -28,18 +28,6 @@ def pytest_funcarg__path1(request):
return wc
class TestWCSvnCommandPath(CommonSvnTests):
- def test_move_file(self, path1): # overrides base class
- try:
- super(TestWCSvnCommandPath, self).test_move_file(path1)
- finally:
- path1.revert(rec=1)
-
- def test_move_directory(self, path1): # overrides base class
- try:
- super(TestWCSvnCommandPath, self).test_move_directory(path1)
- finally:
- path1.revert(rec=1)
-
def test_status_attributes_simple(self, path1):
def assert_nochange(p):
s = p.status()
--- a/testing/path/conftest.py
+++ b/testing/path/conftest.py
@@ -76,3 +76,5 @@ def restore_repowc(obj):
repo.remove()
savedrepo.move(repo)
savedwc.localpath.move(wc.localpath)
+ py.path.svnurl._lsnorevcache.clear()
+ py.path.svnurl._lsrevcache.clear()
--- a/py/impl/path/svnwc.py
+++ b/py/impl/path/svnwc.py
@@ -235,16 +235,6 @@ class SvnPathBase(common.PathBase):
content = self._proplist()
return content
- def info(self):
- """ return an Info structure with svn-provided information. """
- parent = self.dirpath()
- nameinfo_seq = parent._listdir_nameinfo()
- bn = self.basename
- for name, info in nameinfo_seq:
- if name == bn:
- return info
- raise py.error.ENOENT(self)
-
def size(self):
""" Return the size of the file content of the Path. """
return self.info().size
--- a/py/impl/path/svnurl.py
+++ b/py/impl/path/svnurl.py
@@ -213,6 +213,17 @@ checkin message msg."""
lines = [x.strip() for x in lines[1:]]
return svncommon.PropListDict(self, lines)
+ def info(self):
+ """ return an Info structure with svn-provided information. """
+ parent = self.dirpath()
+ nameinfo_seq = parent._listdir_nameinfo()
+ bn = self.basename
+ for name, info in nameinfo_seq:
+ if name == bn:
+ return info
+ raise py.error.ENOENT(self)
+
+
def _listdir_nameinfo(self):
""" return sequence of name-info directory entries of self """
def builder():
--- a/py/impl/path/cacheutil.py
+++ b/py/impl/path/cacheutil.py
@@ -16,6 +16,9 @@ class BasicCache(object):
self.prunenum = int(maxentries - maxentries/8)
self._dict = {}
+ def clear(self):
+ self._dict.clear()
+
def _getentry(self, key):
return self._dict[key]
More information about the pytest-commit
mailing list