[svn r57831] small test cleanups while prepping for pycon uk slides

--HG--
branch : trunk
This commit is contained in:
hpk 2008-09-05 11:02:58 +02:00
parent b52c58159f
commit 621f925985
3 changed files with 14 additions and 25 deletions

View File

@ -1,7 +1,6 @@
import py import py
import sys import sys
from py.path import local from py.path import local
from py.__.path.common import checker
from py.__.path.testing.fscommon import CommonFSTests, setuptestfs from py.__.path.testing.fscommon import CommonFSTests, setuptestfs
class LocalSetup: class LocalSetup:
@ -343,7 +342,6 @@ class TestExecution(LocalSetup):
def test_pypkgdir(): def test_pypkgdir():
datadir = py.test.ensuretemp("pypkgdir") datadir = py.test.ensuretemp("pypkgdir")
pkg = datadir.ensure('pkg1', dir=1) pkg = datadir.ensure('pkg1', dir=1)
pkg.ensure("__init__.py") pkg.ensure("__init__.py")
pkg.ensure("subdir/__init__.py") pkg.ensure("subdir/__init__.py")
@ -354,12 +352,3 @@ def test_homedir():
homedir = py.path.local._gethomedir() homedir = py.path.local._gethomedir()
assert homedir.check(dir=1) assert homedir.check(dir=1)
#class XTestLocalPath(TestLocalPath):
# def __init__(self):
# TestLocalPath.__init__(self)
# self.root = local(self.root)
#
#class XXTestLocalPath(TestLocalPath):
# def __init__(self):
# TestLocalPath.__init__(self)
# self.root = local(self.root)

View File

@ -1,7 +1,6 @@
import py import py
class TestPOSIXLocalPath: class TestPOSIXLocalPath:
#root = local(TestLocalPath.root)
disabled = py.std.sys.platform == 'win32' disabled = py.std.sys.platform == 'win32'
def setup_class(cls): def setup_class(cls):
@ -103,16 +102,17 @@ class TestPOSIXLocalPath:
assert gid == stat.gid assert gid == stat.gid
assert group == stat.group assert group == stat.group
def XXXtest_atime(self): def test_atime(self):
# XXX disabled. this test is just not platform independent enough
# because acesstime resolution is very different through
# filesystems even on one platform.
import time import time
path = self.root.join('samplefile') path = self.root.ensure('samplefile')
atime = path.atime() now = time.time()
time.sleep(1) atime1 = path.atime()
path.read(1) # we could wait here but timer resolution is very
assert path.atime() != atime # system dependent
path.read()
atime2 = path.atime()
duration = time.time() - now
assert (atime2-atime1) <= duration
def test_commondir(self): def test_commondir(self):
# XXX This is here in local until we find a way to implement this # XXX This is here in local until we find a way to implement this

View File

@ -6,9 +6,6 @@ from py.__.path.svn.wccommand import parse_wcinfotime
from py.__.path.svn import svncommon from py.__.path.svn import svncommon
from py.__.conftest import option from py.__.conftest import option
if py.path.local.sysfind('svn') is None:
py.test.skip("cannot test py.path.svn, 'svn' binary not found")
if sys.platform != 'win32': if sys.platform != 'win32':
def normpath(p): def normpath(p):
return p return p
@ -24,8 +21,11 @@ else:
p = win32api.GetShortPathName(p) p = win32api.GetShortPathName(p)
return os.path.normpath(os.path.normcase(p)) return os.path.normpath(os.path.normcase(p))
class TestWCSvnCommandPath(CommonSvnTests): def setup_module(mod):
if py.path.local.sysfind('svn') is None:
py.test.skip("cannot test py.path.svn, 'svn' binary not found")
class TestWCSvnCommandPath(CommonSvnTests):
def setup_class(cls): def setup_class(cls):
repo, cls.root = getrepowc() repo, cls.root = getrepowc()