[py-svn] pytest commit b8b7749ce018: express filter as a listcomp
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Nov 25 02:18:14 CET 2010
# HG changeset patch -- Bitbucket.org
# Project pytest
# URL http://bitbucket.org/hpk42/pytest/overview
# User Benjamin Peterson <benjamin at python.org>
# Date 1290647922 21600
# Node ID b8b7749ce0183b539a50a174575562307b86ca88
# Parent cfcf15d0d1e4aa25a9d6d45f59f5b6e92a19ed1e
express filter as a listcomp
--- 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 = {}
More information about the pytest-commit
mailing list