[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 sys
from py.path import local
from py.__.path.common import checker
from py.__.path.testing.fscommon import CommonFSTests, setuptestfs
class LocalSetup:
@ -343,7 +342,6 @@ class TestExecution(LocalSetup):
def test_pypkgdir():
datadir = py.test.ensuretemp("pypkgdir")
pkg = datadir.ensure('pkg1', dir=1)
pkg.ensure("__init__.py")
pkg.ensure("subdir/__init__.py")
@ -354,12 +352,3 @@ def test_homedir():
homedir = py.path.local._gethomedir()
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
class TestPOSIXLocalPath:
#root = local(TestLocalPath.root)
disabled = py.std.sys.platform == 'win32'
def setup_class(cls):
@ -103,16 +102,17 @@ class TestPOSIXLocalPath:
assert gid == stat.gid
assert group == stat.group
def XXXtest_atime(self):
# XXX disabled. this test is just not platform independent enough
# because acesstime resolution is very different through
# filesystems even on one platform.
def test_atime(self):
import time
path = self.root.join('samplefile')
atime = path.atime()
time.sleep(1)
path.read(1)
assert path.atime() != atime
path = self.root.ensure('samplefile')
now = time.time()
atime1 = path.atime()
# we could wait here but timer resolution is very
# system dependent
path.read()
atime2 = path.atime()
duration = time.time() - now
assert (atime2-atime1) <= duration
def test_commondir(self):
# 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.__.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':
def normpath(p):
return p
@ -24,8 +21,11 @@ else:
p = win32api.GetShortPathName(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):
repo, cls.root = getrepowc()