From a62ff72dfae07ad1cf54bd7dda0bd1af570ca7e0 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 18 Jan 2008 09:08:52 +0100 Subject: remove sys.path modification in pytest --- pytest.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'pytest.py') diff --git a/pytest.py b/pytest.py index f800e9e..f0d3ebf 100644 --- a/pytest.py +++ b/pytest.py @@ -109,7 +109,7 @@ def this_is_a_testdir(dirpath): return osp.basename(dirpath) in ('test', 'tests', 'unittests') -def autopath(projdir=os.getcwd()): +def project_root(projdir=os.getcwd()): """try to find project's root and add it to sys.path""" curdir = osp.abspath(projdir) previousdir = curdir @@ -120,9 +120,6 @@ def autopath(projdir=os.getcwd()): break previousdir = curdir curdir = newdir - else: - sys.path.insert(0, curdir) - sys.path.insert(0, '') return previousdir @@ -509,13 +506,13 @@ def parseargs(): def run(): - rootdir = autopath() options, newargs, explicitfile = parseargs() # mock a new command line sys.argv[1:] = newargs covermode = getattr(options, 'coverage', None) cvg = None if covermode: + rootdir = project_root() # control_import_coverage(rootdir) from logilab.devtools.lib.coverage import Coverage cvg = Coverage([rootdir]) -- cgit v1.2.1