summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2014-10-03 15:16:08 (GMT)
committerR David Murray <rdmurray@bitdance.com>2014-10-03 15:16:08 (GMT)
commitb55f944fa9867bc761f101b6b9702bb78ecfd447 (patch)
tree2b7ec3aed00144fb16ec0e15f1771e0c501110e1 /Lib/test/test_inspect.py
parentb86f08f743095c27641754fbfa941c38cdb381ef (diff)
parent32562d7da388819f46b91feeb74915bc0ad4686a (diff)
downloadcpython-b55f944fa9867bc761f101b6b9702bb78ecfd447.zip
cpython-b55f944fa9867bc761f101b6b9702bb78ecfd447.tar.gz
cpython-b55f944fa9867bc761f101b6b9702bb78ecfd447.tar.bz2
Merge: #12780: update inspect test skipIf for PEP 3147.
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 1da88c4..9586041 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -446,10 +446,11 @@ class TestBuggyCases(GetSourceBase):
def test_method_in_dynamic_class(self):
self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97)
- @unittest.skipIf(
- not hasattr(unicodedata, '__file__') or
- unicodedata.__file__[-4:] in (".pyc", ".pyo"),
- "unicodedata is not an external binary module")
+ # This should not skip for CPython, but might on a repackaged python where
+ # unicodedata is not an external module, or on pypy.
+ @unittest.skipIf(not hasattr(unicodedata, '__file__') or
+ unicodedata.__file__.endswith('.py'),
+ "unicodedata is not an external binary module")
def test_findsource_binary(self):
self.assertRaises(OSError, inspect.getsource, unicodedata)
self.assertRaises(OSError, inspect.findsource, unicodedata)