[pypy-commit] pypy default: split os.path.isdir and generic.isdir tests
mattip
noreply at buildbot.pypy.org
Thu May 15 18:39:52 CEST 2014
Author: mattip <matti.picus at gmail.com>
Branch:
Changeset: r71533:88d226bccdd7
Date: 2014-05-15 19:38 +0300
http://bitbucket.org/pypy/pypy/changeset/88d226bccdd7/
Log: split os.path.isdir and generic.isdir tests
diff --git a/rpython/translator/c/test/test_extfunc.py b/rpython/translator/c/test/test_extfunc.py
--- a/rpython/translator/c/test/test_extfunc.py
+++ b/rpython/translator/c/test/test_extfunc.py
@@ -243,6 +243,20 @@
assert f() == False
def test_os_path_isdir():
+ if sys.platform != 'win32':
+ py.test.skip('use generic.isdir() instead')
+ directory = "./."
+ def fn():
+ return os.path.isdir(directory)
+ f = compile(fn, [])
+ assert f() == True
+ directory = "some/random/name"
+ def fn():
+ return os.path.isdir(directory)
+ f = compile(fn, [])
+ assert f() == False
+
+def test_generic_isdir():
# os.path.isdir is not rpython once pywin is installed (win32 specific)
# genericpath.isdir is better.
directory = "./."
@@ -301,7 +315,7 @@
f1 = compile(does_stuff, [str])
if os.name == 'nt':
assert f1(os.environ['TEMP']) == os.path.realpath(os.environ['TEMP'])
- else:
+ else:
assert f1('/tmp') == os.path.realpath('/tmp')
def test_mkdir_rmdir():
More information about the pypy-commit
mailing list