def wantMethod(self, fn): if py3k: if not hasattr(fn.__self__, 'cls'): return False cls = fn.__self__.cls else: cls = fn.im_class return plugin_base.want_method(cls, fn)
def wantMethod(self, fn): if py3k: if not hasattr(fn.__self__, 'cls'): return False cls = fn.__self__.cls else: cls = fn.im_class return plugin_base.want_method(cls, fn)
def pytest_pycollect_makeitem(collector, name, obj): if inspect.isclass(obj) and plugin_base.want_class(obj): return pytest.Class(name, parent=collector) elif (inspect.isfunction(obj) and isinstance(collector, pytest.Instance) and plugin_base.want_method(collector.cls, obj)): return pytest.Function(name, parent=collector) else: return []
def pytest_pycollect_makeitem(collector, name, obj): if inspect.isclass(obj) and plugin_base.want_class(obj): return pytest.Class(name, parent=collector) elif inspect.isfunction(obj) and \ isinstance(collector, pytest.Instance) and \ plugin_base.want_method(collector.cls, obj): return pytest.Function(name, parent=collector) else: return []