[Python-checkins] cpython (merge 3.4 -> default): Merge: #12780: update inspect test skipIf for PEP 3147.

r.david.murray python-checkins at python.org
Fri Oct 3 17:17:34 CEST 2014


https://hg.python.org/cpython/rev/8120de25932f
changeset:   92770:8120de25932f
parent:      92768:f96b8be9e823
parent:      92769:1745fd612d73
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Oct 03 11:16:08 2014 -0400
summary:
  Merge: #12780: update inspect test skipIf for PEP 3147.

files:
  Lib/test/test_inspect.py |  9 +++++----
  1 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -446,10 +446,11 @@
     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)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list