Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r73191:559bee04d58b Date: 2014-08-29 12:59 -0700 http://bitbucket.org/pypy/pypy/changeset/559bee04d58b/
Log: readapt tests to py3 diff --git a/pypy/interpreter/test/test_nestedscope.py b/pypy/interpreter/test/test_nestedscope.py --- a/pypy/interpreter/test/test_nestedscope.py +++ b/pypy/interpreter/test/test_nestedscope.py @@ -61,7 +61,7 @@ def test_cell_repr(self): import re - from repr import repr as r # Don't shadow builtin repr + from reprlib import repr as r # Don't shadow builtin repr def get_cell(): x = 42 @@ -70,7 +70,7 @@ return inner x = get_cell().__closure__[0] assert re.match(r'<cell at 0x[0-9A-Fa-f]+: int object at 0x[0-9A-Fa-f]+>', repr(x)) - assert re.match(r'<cell at.*\.\.\..*>', r(x)) + assert re.match(r'<cell at 0x.*\.\.\..*>', r(x)) def get_cell(): if False: diff --git a/pypy/module/_csv/test/test_dialect.py b/pypy/module/_csv/test/test_dialect.py --- a/pypy/module/_csv/test/test_dialect.py +++ b/pypy/module/_csv/test/test_dialect.py @@ -89,8 +89,8 @@ exc_info = raises(TypeError, _csv.register_dialect, 'foo1', delimiter="") assert exc_info.value.args[0] == '"delimiter" must be a 1-character string' - exc_info = raises(TypeError, _csv.register_dialect, 'foo1', delimiter=u",") - assert exc_info.value.args[0] == '"delimiter" must be string, not unicode' + exc_info = raises(TypeError, _csv.register_dialect, 'foo1', delimiter=b",") + assert exc_info.value.args[0] == '"delimiter" must be string, not bytes' exc_info = raises(TypeError, _csv.register_dialect, 'foo1', delimiter=4) assert exc_info.value.args[0] == '"delimiter" must be string, not int' 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 @@ -284,14 +284,6 @@ finally: os.chdir(cwdb) - def test_fdopen_keeps_fd_open_on_errors(self): - path = self.path - posix = self.posix - fd = posix.open(path, posix.O_RDONLY) - exc = raises(OSError, posix.fdopen, fd, 'w') - assert str(exc.value) == "[Errno 22] Invalid argument" - posix.close(fd) # fd should not be closed - def test_getcwdb(self): assert isinstance(self.posix.getcwdb(), bytes) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit