[svn r37447] config._reparse() from current dir can drag in conftest.py

files (happened to me because i had two py lib checkouts)

--HG--
branch : trunk
This commit is contained in:
hpk 2007-01-27 20:24:41 +01:00
parent 8f540fe7c6
commit 181f6cde23
1 changed files with 9 additions and 3 deletions

View File

@ -5,12 +5,18 @@ from py.__.test.terminal.out import getout
from StringIO import StringIO
import sys
def newconfig(*args):
tmpdir = py.test.ensuretemp("newconfig")
args = list(args)
args.append(tmpdir)
return py.test.config._reparse(args)
def test_repr_source():
source = py.code.Source("""
def f(x):
pass
""").strip()
config = py.test.config._reparse([])
config = newconfig()
s = StringIO()
out = getout(s)
p = Presenter(out, config)
@ -32,7 +38,7 @@ def test_repr_failure_explanation():
except:
e = py.code.ExceptionInfo()
return e
config = py.test.config._reparse([])
config = newconfig()
s = StringIO()
out = getout(s)
p = Presenter(out, config)
@ -42,7 +48,7 @@ def test_repr_failure_explanation():
assert s.getvalue().startswith("> ")
def test_repr_local():
config = py.test.config._reparse(['--showlocals'])
config = newconfig('--showlocals')
s = StringIO()
out = getout(s)
p = Presenter(out, config)