Commits

Jason Pellerin  committed 71509f2

Restored loading tests from methods, for 2.6 compat

  • Participants
  • Parent commits 1593df1
  • Branches py3k

Comments (0)

Files changed (1)

File nose/loader.py

                 return self.loadTestsFromGenerator(obj, parent)
             else:
                 return FunctionTestCase(obj)
+        elif ismethod(obj):
+            if parent is None:
+                parent = obj.__class__
+            if issubclass(parent, unittest.TestCase):
+                return parent(obj.__name__)
+            else:
+                if isgenerator(obj):
+                    return self.loadTestsFromGeneratorMethod(obj, parent)
+                else:
+                    return MethodTestCase(obj, cls=parent)
         else:
             return Failure(TypeError,
                            "Can't make a test from %s" % obj)