summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pyclbr.py
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-04-18 01:39:25 (GMT)
committerPhillip J. Eby <pje@telecommunity.com>2006-04-18 01:39:25 (GMT)
commit742cd24c029f1fe84d2a60f84e408c72bd3ed34d (patch)
treefd2ded649efda72ad90d37c359f95141c6cc4321 /Lib/test/test_pyclbr.py
parent9582c148b6bd0ff21678030709f51e7f57b223bd (diff)
downloadcpython-742cd24c029f1fe84d2a60f84e408c72bd3ed34d.zip
cpython-742cd24c029f1fe84d2a60f84e408c72bd3ed34d.tar.gz
cpython-742cd24c029f1fe84d2a60f84e408c72bd3ed34d.tar.bz2
test_pyclbr goes nuts when a module contains code to try importing a class
and provide a substitute if the import fails, because pyclbr sees the class definition. Changed to ignore such cases' base classes and methods, since they will not match.
Diffstat (limited to 'Lib/test/test_pyclbr.py')
-rw-r--r--Lib/test/test_pyclbr.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index 87572ca..d2f8c76 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -95,6 +95,9 @@ class PyclbrTest(TestCase):
self.assert_(isinstance(py_item, (FunctionType, BuiltinFunctionType)))
else:
self.failUnless(isinstance(py_item, (ClassType, type)))
+ if py_item.__module__!=moduleName:
+ continue # skip classes that came from somewhere else
+
real_bases = [base.__name__ for base in py_item.__bases__]
pyclbr_bases = [ getattr(base, 'name', base)
for base in value.super ]