Commit b55f944f authored by R David Murray's avatar R David Murray

Merge: #12780: update inspect test skipIf for PEP 3147.

parents b86f08f7 32562d7d
...@@ -446,10 +446,11 @@ class TestBuggyCases(GetSourceBase): ...@@ -446,10 +446,11 @@ class TestBuggyCases(GetSourceBase):
def test_method_in_dynamic_class(self): def test_method_in_dynamic_class(self):
self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97) self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97)
@unittest.skipIf( # This should not skip for CPython, but might on a repackaged python where
not hasattr(unicodedata, '__file__') or # unicodedata is not an external module, or on pypy.
unicodedata.__file__[-4:] in (".pyc", ".pyo"), @unittest.skipIf(not hasattr(unicodedata, '__file__') or
"unicodedata is not an external binary module") unicodedata.__file__.endswith('.py'),
"unicodedata is not an external binary module")
def test_findsource_binary(self): def test_findsource_binary(self):
self.assertRaises(OSError, inspect.getsource, unicodedata) self.assertRaises(OSError, inspect.getsource, unicodedata)
self.assertRaises(OSError, inspect.findsource, unicodedata) self.assertRaises(OSError, inspect.findsource, unicodedata)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment