From 181f6cde23cc513c425e809024572dd48930141a Mon Sep 17 00:00:00 2001 From: hpk Date: Sat, 27 Jan 2007 20:24:41 +0100 Subject: [PATCH] [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 --- py/test/testing/test_repr.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/py/test/testing/test_repr.py b/py/test/testing/test_repr.py index 0ce2a1228..c01258162 100644 --- a/py/test/testing/test_repr.py +++ b/py/test/testing/test_repr.py @@ -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)