[py-svn] py-trunk commit 528f14456c8c: fix accidentally broken pylib's own conftest.py
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Dec 30 17:17:59 CET 2009
# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview/
# User holger krekel <holger at merlinux.eu>
# Date 1262189508 -3600
# Node ID 528f14456c8c6feeb5cd13afbc9bb51b499e9111
# Parent 9e18a1a2a67a215f5f9ffef2679be08c7061d7c2
fix accidentally broken pylib's own conftest.py
--- a/conftest.py
+++ b/conftest.py
@@ -1,4 +1,5 @@
import py
+import sys
pytest_plugins = '_pytest doctest pytester'.split()
@@ -57,12 +58,15 @@ def getsocketspec(config):
def pytest_generate_tests(metafunc):
multi = getattr(metafunc.function, 'multi', None)
- if multi is None:
- return
- assert len(multi.kwargs) == 1
- for name, l in multi.kwargs.items():
- for val in l:
- metafunc.addcall(funcargs={name: val})
+ if multi is not None:
+ assert len(multi.kwargs) == 1
+ for name, l in multi.kwargs.items():
+ for val in l:
+ metafunc.addcall(funcargs={name: val})
+ elif 'anypython' in metafunc.funcargnames:
+ for name in ('python2.4', 'python2.5', 'python2.6',
+ 'python2.7', 'python3.1', 'pypy-c', 'jython'):
+ metafunc.addcall(id=name, param=name)
# XXX copied from execnet's conftest.py - needs to be merged
winpymap = {
@@ -73,12 +77,6 @@ winpymap = {
'python3.1': r'C:\Python31\python.exe',
}
-def pytest_generate_tests(metafunc):
- if 'anypython' in metafunc.funcargnames:
- for name in ('python2.4', 'python2.5', 'python2.6',
- 'python2.7', 'python3.1', 'pypy-c', 'jython'):
- metafunc.addcall(id=name, param=name)
-
def getexecutable(name, cache={}):
try:
return cache[name]
More information about the pytest-commit
mailing list