[pypy-svn] rev 2621 - pypy/trunk/src/pypy/tool

sschwarzer at codespeak.net sschwarzer at codespeak.net
Sat Dec 20 10:16:10 CET 2003


Author: sschwarzer
Date: Sat Dec 20 10:16:09 2003
New Revision: 2621

Modified:
   pypy/trunk/src/pypy/tool/newtest.py
Log:
Extended some comments.


Modified: pypy/trunk/src/pypy/tool/newtest.py
==============================================================================
--- pypy/trunk/src/pypy/tool/newtest.py	(original)
+++ pypy/trunk/src/pypy/tool/newtest.py	Sat Dec 20 10:16:09 2003
@@ -423,8 +423,10 @@
     def _items_from_module(self, module):
         """Return a list of TestItems read from the given module."""
         items = []
-        # scan the module for classes derived from TestCase
+        # scan the module for test functions, and for classes derived
+        # from TestCase
         for obj in vars(module).values():
+            # find TestCase classes and methods within them
             if inspect.isclass(obj) and issubclass(obj, TestCase):
                 # we found a TestCase class, now scan it for test methods
                 for obj2 in vars(obj).values():
@@ -432,6 +434,7 @@
                     if inspect.isfunction(obj2) and \
                       obj2.__name__.startswith("test"):
                         items.append(TestItem(module, cls=obj, callable=obj2))
+            # find test functions
             elif (callable(obj) and hasattr(obj, '__name__') and
                   obj.__name__.startswith('test_')):
                 items.append(TestItem(module, callable=obj))


More information about the Pypy-commit mailing list