[py-svn] r57061 - in py/branch/event/py/test2: . testing
hpk at codespeak.net
hpk at codespeak.net
Thu Aug 7 15:57:44 CEST 2008
Author: hpk
Date: Thu Aug 7 15:57:41 2008
New Revision: 57061
Modified:
py/branch/event/py/test2/config.py
py/branch/event/py/test2/testing/test_config.py
Log:
topdir for a file is its dirpath
Modified: py/branch/event/py/test2/config.py
==============================================================================
--- py/branch/event/py/test2/config.py (original)
+++ py/branch/event/py/test2/config.py Thu Aug 7 15:57:41 2008
@@ -238,6 +238,8 @@
assert p, "cannot determine common basedir of %s" %(args,)
pkgdir = p.pypkgpath()
if pkgdir is None:
+ if p.check(file=1):
+ p = p.dirpath()
return p
else:
return pkgdir.dirpath()
Modified: py/branch/event/py/test2/testing/test_config.py
==============================================================================
--- py/branch/event/py/test2/testing/test_config.py (original)
+++ py/branch/event/py/test2/testing/test_config.py Thu Aug 7 15:57:41 2008
@@ -114,6 +114,8 @@
assert gettopdir([tmp]) == tmp
topdir =gettopdir([tmp.join("hello"), tmp.join("world")])
assert topdir == tmp
+ somefile = tmp.ensure("somefile.py")
+ assert gettopdir([somefile]) == tmp
def test_gettopdir_pypkg():
tmp = py.test2.ensuretemp("topdir2")
More information about the pytest-commit
mailing list