[py-svn] r33352 - py/dist/py/test/rsession

fijal at codespeak.net fijal at codespeak.net
Mon Oct 16 23:25:59 CEST 2006


Author: fijal
Date: Mon Oct 16 23:25:28 2006
New Revision: 33352

Modified:
   py/dist/py/test/rsession/hostmanage.py
Log:
Added localhost optimisation.


Modified: py/dist/py/test/rsession/hostmanage.py
==============================================================================
--- py/dist/py/test/rsession/hostmanage.py	(original)
+++ py/dist/py/test/rsession/hostmanage.py	Mon Oct 16 23:25:28 2006
@@ -39,23 +39,32 @@
     hosts = []
 
     for host in sshhosts:
-        if isinstance(relpath, str):
-            assert not os.path.isabs(relpath), relpath
-            remoterootpath = relpath
-        else:
-            remoterootpath = relpath[host]
-        # XXX: because of NFS we do create different directories
-        #      otherwise, .pyc files overlap
-        remoterootpath += "-" + host
-        if remote_python is None:
-            gw = py.execnet.SshGateway(host)
+        
+        if host != 'localhost':
+            if remote_python is None:
+                gw = py.execnet.SshGateway(host)
+            else:
+                gw = py.execnet.SshGateway(host, remotepython=remote_python)
+            if isinstance(relpath, str):
+                assert not os.path.isabs(relpath), relpath
+                remoterootpath = relpath
+            else:
+                remoterootpath = relpath[host]
+            # XXX: because of NFS we do create different directories
+            #      otherwise, .pyc files overlap
+            remoterootpath += "-" + host
+    
+            hosts.append((host, gw, remoterootpath))
         else:
-            gw = py.execnet.SshGateway(host, remotepython=remote_python)
-
-        hosts.append((host, gw, remoterootpath))
+            if remote_python is None:
+                gw = py.execnet.PopenGateway()
+            else:
+                gw = py.execnet.PopenGateway(remotepython=remote_python)
+            gw.sshaddress = 'localhost'
+            hosts.append((host, gw, str(pkgdir.dirpath())))
 
     # rsyncing
-    rsynced = {}
+    rsynced = {'localhost':True}
 
     rsync = HostRSync(rsync_roots)
     for host, gw, remoterootpath in hosts:



More information about the pytest-commit mailing list