[py-svn] r10938 - py/dist/py/test/tkinter

jan at codespeak.net jan at codespeak.net
Wed Apr 20 19:56:55 CEST 2005


Author: jan
Date: Wed Apr 20 19:56:55 2005
New Revision: 10938

Modified:
   py/dist/py/test/tkinter/backend.py
Log:
reuse existing gateway


Modified: py/dist/py/test/tkinter/backend.py
==============================================================================
--- py/dist/py/test/tkinter/backend.py	(original)
+++ py/dist/py/test/tkinter/backend.py	Wed Apr 20 19:56:55 2005
@@ -72,6 +72,7 @@
         self._message_callback = Null()
         self._messages_callback = Null()
         self.config = config
+        self.gateway = None
 
     def running(self):
         '''are there tests running?'''
@@ -83,6 +84,8 @@
     def shutdown(self):
         if self.running:
             self.channel.close()
+            self.channel.gateway.exit()
+            self.gateway = None
     
     def get_repository(self):
         '''return the repository'''
@@ -113,9 +116,10 @@
         if config is None:
             config = self.config
         self.testrepository = TestRepository()
-        gateway = py.execnet.PopenGateway(config.option.executable) 
-        self.channel = gateway.newchannel(receiver = self.queue.put)
-        gateway.remote_exec(channel = self.channel, source = '''
+        if not self.gateway:
+            self.gateway = py.execnet.PopenGateway(config.option.executable) 
+        self.channel = self.gateway.newchannel(receiver = self.queue.put)
+        self.gateway.remote_exec(channel = self.channel, source = '''
         import py
         from py.__impl__.test.tkinter.backend import remote
 



More information about the pytest-commit mailing list