Kaydet (Commit) 87855540 authored tarafından R. David Murray's avatar R. David Murray

Fix test failure on Windows, and add skip check if even unicodedata

turns out not to be an external module on some other platform.
üst 8953913c
...@@ -10,7 +10,7 @@ from test import inspect_fodder as mod ...@@ -10,7 +10,7 @@ from test import inspect_fodder as mod
from test import inspect_fodder2 as mod2 from test import inspect_fodder2 as mod2
# C module for test_findsource_binary # C module for test_findsource_binary
import time import unicodedata
# Functions tested in this suite: # Functions tested in this suite:
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode, # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
...@@ -332,9 +332,13 @@ class TestBuggyCases(GetSourceBase): ...@@ -332,9 +332,13 @@ 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(
not hasattr(unicodedata, '__file__') or
unicodedata.__file__[-4:] in (".pyc", ".pyo"),
"unicodedata is not an external binary module")
def test_findsource_binary(self): def test_findsource_binary(self):
self.assertRaises(IOError, inspect.getsource, time) self.assertRaises(IOError, inspect.getsource, unicodedata)
self.assertRaises(IOError, inspect.findsource, time) self.assertRaises(IOError, inspect.findsource, unicodedata)
# Helper for testing classify_class_attrs. # Helper for testing classify_class_attrs.
def attrs_wo_objs(cls): def attrs_wo_objs(cls):
......
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