Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r55212:b1a7b2e73d80
Date: 2012-05-30 23:10 +0200
http://bitbucket.org/pypy/pypy/changeset/b1a7b2e73d80/
Log: Fixes after merge
diff --git a/pypy/module/__builtin__/test/test_functional.py
b/pypy/module/__builtin__/test/test_functional.py
--- a/pypy/module/__builtin__/test/test_functional.py
+++ b/pypy/module/__builtin__/test/test_functional.py
@@ -146,22 +146,22 @@
y = callable(*args)
assert list(y) == list(x)
- def test_xrange_iter_reduce(self):
- x = iter(xrange(2, 9, 3))
- x.next()
+ def test_range_iter_reduce(self):
+ x = iter(range(2, 9, 3))
+ next(x)
callable, args = x.__reduce__()
y = callable(*args)
assert list(y) == list(x)
- def test_xrange_iter_reduce_one(self):
- x = iter(xrange(2, 9))
- x.next()
+ def test_range_iter_reduce_one(self):
+ x = iter(range(2, 9))
+ next(x)
callable, args = x.__reduce__()
y = callable(*args)
assert list(y) == list(x)
- def test_lib_python_xrange_optimization(self):
- x = xrange(1)
+ def test_lib_python_range_optimization(self):
+ x = range(1)
assert type(reversed(x)) == type(iter(x))
diff --git a/pypy/module/posix/test/test_posix2.py
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -839,67 +839,6 @@
# How else could we test that getlogin is properly
# working?
- def test_tmpfile(self):
- os = self.posix
- f = os.tmpfile()
- f.write("xxx")
- f.flush()
- f.seek(0, 0)
- assert isinstance(f, file)
- assert f.read() == 'xxx'
-
- def test_tmpnam(self):
- import stat, os
- s1 = os.tmpnam()
- s2 = os.tmpnam()
- assert s1 != s2
- def isdir(s):
- try:
- return stat.S_ISDIR(os.stat(s).st_mode)
- except OSError:
- return -1
- assert isdir(s1) == -1
- assert isdir(s2) == -1
- assert isdir(os.path.dirname(s1)) == 1
- assert isdir(os.path.dirname(s2)) == 1
-
- def test_tempnam(self):
- import stat, os
- for dir in [None, self.udir]:
- for prefix in [None, 'foobar']:
- s1 = os.tempnam(dir, prefix)
- s2 = os.tempnam(dir, prefix)
- assert s1 != s2
- def isdir(s):
- try:
- return stat.S_ISDIR(os.stat(s).st_mode)
- except OSError:
- return -1
- assert isdir(s1) == -1
- assert isdir(s2) == -1
- assert isdir(os.path.dirname(s1)) == 1
- assert isdir(os.path.dirname(s2)) == 1
- if dir:
- assert os.path.dirname(s1) == dir
- assert os.path.dirname(s2) == dir
- assert os.path.basename(s1).startswith(prefix or 'tmp')
- assert os.path.basename(s2).startswith(prefix or 'tmp')
-
- def test_tmpnam_warning(self):
- import warnings, os
- #
- def f_tmpnam_warning(): os.tmpnam() # a single line
- #
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter("always")
- f_tmpnam_warning()
- assert len(w) == 1
- assert issubclass(w[-1].category, RuntimeWarning)
- assert "potential security risk" in str(w[-1].message)
- # check that the warning points to the call to os.tmpnam(),
- # not to some code inside app_posix.py
- assert w[-1].lineno == f_tmpnam_warning.func_code.co_firstlineno
-
def test_has_kill(self):
import os
assert hasattr(os, 'kill')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit