Author: marky1991
Branch: py3.3
Changeset: r81695:260044caf4ee
Date: 2015-12-15 12:49 -0500
http://bitbucket.org/pypy/pypy/changeset/260044caf4ee/
Log: Fix tests in stderrprinter and io.
diff --git a/pypy/module/__pypy__/test/test_stderrprinter.py
b/pypy/module/__pypy__/test/test_stderrprinter.py
--- a/pypy/module/__pypy__/test/test_stderrprinter.py
+++ b/pypy/module/__pypy__/test/test_stderrprinter.py
@@ -7,7 +7,9 @@
p.close() # this should be a no-op
p.flush() # this should be a no-op
assert p.fileno() == 2
- assert p.isatty()
+ #It doesn't make sense to assert this. Stderror could be a tty (the
terminal)
+ #or not, depending on how we are running the tests.
+ #assert p.isatty()
assert p.write('foo') == 3
raises(TypeError, p.write, b'foo')
diff --git a/pypy/module/_io/test/test_io.py b/pypy/module/_io/test/test_io.py
--- a/pypy/module/_io/test/test_io.py
+++ b/pypy/module/_io/test/test_io.py
@@ -390,7 +390,7 @@
raises(TypeError, pickle.dumps, f, protocol)
def test_mod(self):
- import _io
+ import _io, _frozen_importlib
typemods = dict((t, t.__module__) for t in vars(_io).values()
if isinstance(t, type))
for t, mod in typemods.items():
@@ -398,6 +398,11 @@
assert mod == 'builtins'
elif t is _io.UnsupportedOperation:
assert mod == 'io'
+ #TODO: Make sure this is a reasonable thing to do. Check if there
is
+ #a cleaner way to do these checks or if these checks even make
sense
+ #in general. They seem really brittle.
+ elif t is _frozen_importlib.BuiltinImporter:
+ assert mod == "_frozen_importlib"
else:
assert mod == '_io'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit