[py-svn] pytest commit 01f97e561a1a: some fixes to make cross linux/windows remote testing work again

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Nov 13 19:46:38 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pytest
# URL http://bitbucket.org/hpk42/pytest/overview
# User holger krekel <holger at merlinux.eu>
# Date 1289673988 -3600
# Node ID 01f97e561a1afcb664558a7fb6e5bb92fd6e9bcb
# Parent  54e78a7ce4980b1cab0ed40ca0e16dbea31394c2
some fixes to make cross linux/windows remote testing work again

--- a/pytest.py
+++ b/pytest.py
@@ -5,7 +5,7 @@ see http://pytest.org for documentation 
 
 (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

--- 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'],

--- 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)
 

--- 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):

--- 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



More information about the pytest-commit mailing list