Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b565577

Browse files
committed
Merged revisions 72630 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r72630 | r.david.murray | 2009-05-14 12:12:57 -0400 (Thu, 14 May 2009) | 3 lines Fix test failure on Windows, and add skip check if even unicodedata turns out not to be an external module on some other platform. ........
1 parent dbe3449 commit b565577

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Lib/test/test_inspect.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from test import inspect_fodder2 as mod2
1313

1414
# C module for test_findsource_binary
15-
import time
15+
import unicodedata
1616

1717
# Functions tested in this suite:
1818
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
@@ -339,9 +339,13 @@ def test_with_comment_instead_of_docstring(self):
339339
def test_method_in_dynamic_class(self):
340340
self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97)
341341

342+
@unittest.skipIf(
343+
not hasattr(unicodedata, '__file__') or
344+
unicodedata.__file__[-4:] in (".pyc", ".pyo"),
345+
"unicodedata is not an external binary module")
342346
def test_findsource_binary(self):
343-
self.assertRaises(IOError, inspect.getsource, time)
344-
self.assertRaises(IOError, inspect.findsource, time)
347+
self.assertRaises(IOError, inspect.getsource, unicodedata)
348+
self.assertRaises(IOError, inspect.findsource, unicodedata)
345349

346350
# Helper for testing classify_class_attrs.
347351
def attrs_wo_objs(cls):

0 commit comments

Comments
 (0)