diff options
author | R. David Murray <rdmurray@bitdance.com> | 2009-05-14 16:12:57 (GMT) |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2009-05-14 16:12:57 (GMT) |
commit | 878555401e28a6da0ce05d2de637058a20ea7504 (patch) | |
tree | 2af57b86bfe62a037ce2c6011286dcc3798f900a /Lib/test | |
parent | 8953913cf565b18742c16622a0b486e05bf2a113 (diff) | |
download | cpython-878555401e28a6da0ce05d2de637058a20ea7504.zip cpython-878555401e28a6da0ce05d2de637058a20ea7504.tar.gz cpython-878555401e28a6da0ce05d2de637058a20ea7504.tar.bz2 |
Fix test failure on Windows, and add skip check if even unicodedata
turns out not to be an external module on some other platform.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_inspect.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 5c41433..4e597f9 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -10,7 +10,7 @@ from test import inspect_fodder as mod from test import inspect_fodder2 as mod2 # C module for test_findsource_binary -import time +import unicodedata # Functions tested in this suite: # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode, @@ -332,9 +332,13 @@ 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") def test_findsource_binary(self): - self.assertRaises(IOError, inspect.getsource, time) - self.assertRaises(IOError, inspect.findsource, time) + self.assertRaises(IOError, inspect.getsource, unicodedata) + self.assertRaises(IOError, inspect.findsource, unicodedata) # Helper for testing classify_class_attrs. def attrs_wo_objs(cls): |