fix accidentally broken pylib's own conftest.py
--HG-- branch : trunk
This commit is contained in:
		
							parent
							
								
									77667c11d2
								
							
						
					
					
						commit
						94bc770786
					
				
							
								
								
									
										14
									
								
								conftest.py
								
								
								
								
							
							
						
						
									
										14
									
								
								conftest.py
								
								
								
								
							| 
						 | 
					@ -1,4 +1,5 @@
 | 
				
			||||||
import py
 | 
					import py
 | 
				
			||||||
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pytest_plugins = '_pytest doctest pytester'.split()
 | 
					pytest_plugins = '_pytest doctest pytester'.split()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,12 +58,15 @@ def getsocketspec(config):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def pytest_generate_tests(metafunc):
 | 
					def pytest_generate_tests(metafunc):
 | 
				
			||||||
    multi = getattr(metafunc.function, 'multi', None)
 | 
					    multi = getattr(metafunc.function, 'multi', None)
 | 
				
			||||||
    if multi is None:
 | 
					    if multi is not None:
 | 
				
			||||||
        return
 | 
					 | 
				
			||||||
        assert len(multi.kwargs) == 1
 | 
					        assert len(multi.kwargs) == 1
 | 
				
			||||||
        for name, l in multi.kwargs.items():
 | 
					        for name, l in multi.kwargs.items():
 | 
				
			||||||
            for val in l:
 | 
					            for val in l:
 | 
				
			||||||
                metafunc.addcall(funcargs={name: val})
 | 
					                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 
 | 
					# XXX copied from execnet's conftest.py - needs to be merged 
 | 
				
			||||||
winpymap = {
 | 
					winpymap = {
 | 
				
			||||||
| 
						 | 
					@ -73,12 +77,6 @@ winpymap = {
 | 
				
			||||||
    'python3.1': r'C:\Python31\python.exe',
 | 
					    '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={}):
 | 
					def getexecutable(name, cache={}):
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        return cache[name]
 | 
					        return cache[name]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue