diff --git a/_pytest/core.py b/_pytest/core.py index 5d4615ce2..1f01a243b 100644 --- a/_pytest/core.py +++ b/_pytest/core.py @@ -157,14 +157,17 @@ class PluginManager(object): def consider_setuptools_entrypoints(self): try: - from pkg_resources import iter_entry_points + from pkg_resources import iter_entry_points, DistributionNotFound except ImportError: return # XXX issue a warning for ep in iter_entry_points('pytest11'): name = canonical_importname(ep.name) if name in self._name2plugin: continue - plugin = ep.load() + try: + plugin = ep.load() + except DistributionNotFound: + continue self.register(plugin, name=name) def consider_preparse(self, args): diff --git a/_pytest/pytester.py b/_pytest/pytester.py index efe5ab19a..35d05b0af 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -400,10 +400,8 @@ class TmpTestdir: return colitem def popen(self, cmdargs, stdout, stderr, **kw): - if not hasattr(py.std, 'subprocess'): - py.test.skip("no subprocess module") env = os.environ.copy() - env['PYTHONPATH'] = ":".join(filter(None, [ + env['PYTHONPATH'] = os.pathsep.join(filter(None, [ str(os.getcwd()), env.get('PYTHONPATH', '')])) kw['env'] = env #print "env", env @@ -449,12 +447,13 @@ class TmpTestdir: def _getpybinargs(self, scriptname): if not self.request.config.getvalue("notoolsonpath"): - script = py.path.local.sysfind(scriptname) + import pytest + script = pytest.__file__.strip("co") assert script, "script %r not found" % scriptname # XXX we rely on script refering to the correct environment # we cannot use "(py.std.sys.executable,script)" # becaue on windows the script is e.g. a py.test.exe - return (script,) + return (py.std.sys.executable, script,) else: py.test.skip("cannot run %r with --no-tools-on-path" % scriptname) diff --git a/pytest.py b/pytest.py index 45af8aa1a..7715484a0 100644 --- a/pytest.py +++ b/pytest.py @@ -5,7 +5,7 @@ see http://pytest.org for documentation and details (c) Holger Krekel and others, 2004-2010 """ -__version__ = '2.0.0.dev26' +__version__ = '2.0.0.dev27' __all__ = ['main'] from _pytest.core import main, UsageError, _preloadplugins diff --git a/setup.py b/setup.py index 8d26ebafd..8823eb2df 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.0.0.dev26', + version='2.0.0.dev27', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/tox.ini b/tox.ini index bdae04cec..37b4583c9 100644 --- a/tox.ini +++ b/tox.ini @@ -36,6 +36,12 @@ commands= [testenv:py31] deps=pylib +[testenv:py31-xdist] +deps=pytest-xdist +commands= + py.test -n3 -rfsxX \ + --junitxml={envlogdir}/junit-{envname}.xml [] + [testenv:py32] deps=pylib @@ -52,5 +58,5 @@ commands= minversion=2.0 plugins=pytester addopts=-rfx --pyargs -rsyncdirs=pytest.py _pytest testing +rsyncdirs=tox.ini pytest.py _pytest testing