Add missing __test__ check for test discovery.
This commit is contained in:
@@ -503,6 +503,8 @@ def _get_xunit_func(obj, name):
|
||||
class Class(PyCollector):
|
||||
""" Collector for test methods. """
|
||||
def collect(self):
|
||||
if not safe_getattr(self.obj, "__test__", True):
|
||||
return []
|
||||
if hasinit(self.obj):
|
||||
self.warn("C1", "cannot collect test class %r because it has a "
|
||||
"__init__ constructor" % self.obj.__name__)
|
||||
|
||||
Reference in New Issue
Block a user