[py-svn] r63232 - in py/trunk/py/execnet: . testing

hpk at codespeak.net hpk at codespeak.net
Mon Mar 23 16:01:17 CET 2009


Author: hpk
Date: Mon Mar 23 16:01:15 2009
New Revision: 63232

Modified:
   py/trunk/py/execnet/gateway.py
   py/trunk/py/execnet/testing/test_gateway.py
Log:
nicer repr for gateway._rinfo() informatio about remote location


Modified: py/trunk/py/execnet/gateway.py
==============================================================================
--- py/trunk/py/execnet/gateway.py	(original)
+++ py/trunk/py/execnet/gateway.py	Mon Mar 23 16:01:15 2009
@@ -247,6 +247,10 @@
             class RInfo:
                 def __init__(self, **kwargs):
                     self.__dict__.update(kwargs)
+                def __repr__(self):
+                    info = ", ".join(["%s=%s" % item 
+                            for item in self.__dict__.items()])
+                    return "<RInfo %r>" % info
             self._cache_rinfo = RInfo(**self.remote_exec("""
                 import sys, os
                 channel.send(dict(

Modified: py/trunk/py/execnet/testing/test_gateway.py
==============================================================================
--- py/trunk/py/execnet/testing/test_gateway.py	(original)
+++ py/trunk/py/execnet/testing/test_gateway.py	Mon Mar 23 16:01:15 2009
@@ -446,6 +446,8 @@
         assert rinfo.executable 
         assert rinfo.cwd 
         assert rinfo.version_info 
+        s = repr(rinfo) 
+        assert s.find(rinfo.cwd) != -1
         old = self.gw.remote_exec("""
             import os.path
             cwd = os.getcwd()



More information about the pytest-commit mailing list