[Python-checkins] r45512 - python/trunk/Lib/test/test_pyclbr.py
phillip.eby
python-checkins at python.org
Tue Apr 18 03:39:25 CEST 2006
Author: phillip.eby
Date: Tue Apr 18 03:39:25 2006
New Revision: 45512
Modified:
python/trunk/Lib/test/test_pyclbr.py
Log:
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.
Modified: python/trunk/Lib/test/test_pyclbr.py
==============================================================================
--- python/trunk/Lib/test/test_pyclbr.py (original)
+++ python/trunk/Lib/test/test_pyclbr.py Tue Apr 18 03:39:25 2006
@@ -95,6 +95,9 @@
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 ]
More information about the Python-checkins
mailing list