fix standalone script generation on windows, make tests not do a chdir() so that distributed testing discovers the transferred lib

--HG--
branch : trunk
This commit is contained in:
holger krekel
2010-01-01 21:54:27 +01:00
parent 47df1e16b6
commit e0dd171e45
3 changed files with 9 additions and 10 deletions

View File

@@ -4,11 +4,15 @@ import subprocess
def pytest_funcarg__standalone(request):
return request.cached_setup(scope="module", setup=lambda: Standalone(request))
pytestmark = py.test.mark.nochdir
class Standalone:
def __init__(self, request):
self.testdir = request.getfuncargvalue("testdir")
self.script = self.testdir.tmpdir.join("mypytest")
self.testdir.runpytest("--genscript=%s" % self.script)
result = self.testdir.runpytest("--genscript=%s" % self.script)
assert result.ret == 0
assert self.script.check()
def run(self, anypython, testdir, *args):
testdir.chdir()