diff --git a/_pytest/python.py b/_pytest/python.py index a0a8ca8e2..67d62a115 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -564,7 +564,7 @@ class FuncargRequest: self._pyfuncitem = pyfuncitem if hasattr(pyfuncitem, '_requestparam'): self.param = pyfuncitem._requestparam - extra = filter(None, [self.module, self.instance]) + extra = [obj for obj in (self.module, self.instance) if obj] self._plugins = pyfuncitem.getplugins() + extra self._funcargs = self._pyfuncitem.funcargs.copy() self._name2factory = {}