From bb8141e27c524c57c673e9f70522a252b7ff9e6c Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 6 May 2015 14:58:46 +0200 Subject: [PATCH] - make sure sub pytest runs use the same basetemp - depend on pluggy < 0.3 --HG-- branch : pluggy1 --- _pytest/__init__.py | 2 +- _pytest/pytester.py | 20 ++++++++++++++------ setup.py | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 81fca72a9..e731c2e3a 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.8.0.dev2' +__version__ = '2.8.0.dev3' diff --git a/_pytest/pytester.py b/_pytest/pytester.py index baddc913c..4032ff04d 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -712,8 +712,20 @@ class Testdir: option "--runpytest" and return a :py:class:`RunResult`. """ + args = self._ensure_basetemp(args) return self._runpytest_method(*args, **kwargs) + def _ensure_basetemp(self, args): + args = [str(x) for x in args] + for x in args: + if str(x).startswith('--basetemp'): + #print ("basedtemp exists: %s" %(args,)) + break + else: + args.append("--basetemp=%s" % self.tmpdir.dirpath('basetemp')) + #print ("added basetemp: %s" %(args,)) + return args + def parseconfig(self, *args): """Return a new py.test Config instance from given commandline args. @@ -726,12 +738,8 @@ class Testdir: modules which will be registered with the PluginManager. """ - args = [str(x) for x in args] - for x in args: - if str(x).startswith('--basetemp'): - break - else: - args.append("--basetemp=%s" % self.tmpdir.dirpath('basetemp')) + args = self._ensure_basetemp(args) + import _pytest.config config = _pytest.config._prepareconfig(args, self.plugins) # we don't know what the test will do with this half-setup config diff --git a/setup.py b/setup.py index 3a4fd391f..0cd643a36 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ def has_environment_marker_support(): def main(): - install_requires = ['py>=1.4.27.dev2', 'pluggy>=0.1.0,<1.0.0'] + install_requires = ['py>=1.4.27.dev2', 'pluggy>=0.2.0,<0.3.0'] extras_require = {} if has_environment_marker_support(): extras_require[':python_version=="2.6" or python_version=="3.0" or python_version=="3.1"'] = ['argparse']