call site 0 for execnet.SshGateway.__repr__
test/rsession/testing/test_hostmanage.py - line 57
54
55
56
57
   def test_non_existing_hosts(self):
       host = HostInfo("alskdjalsdkjasldkajlsd")
       py.test.raises((py.process.cmdexec.Error, IOError, EOFError), 
->                    host.initgateway)
test/raises.py - line 30
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
   def raises(ExpectedException, *args, **kwargs):
       """ raise AssertionError, if target code does not raise the expected
           exception.
       """
       assert args
       __tracebackhide__ = True 
       if isinstance(args[0], str):
           expr, = args
           assert isinstance(expr, str)
           frame = sys._getframe(1)
           loc = frame.f_locals.copy()
           loc.update(kwargs)
           #print "raises frame scope: %r" % frame.f_locals
           source = py.code.Source(expr)
           try:
               exec source.compile() in frame.f_globals, loc
               #del __traceback__
               # XXX didn'T mean f_globals == f_locals something special?
               #     this is destroyed here ...
           except ExpectedException:
               return py.code.ExceptionInfo()
       else:
           func = args[0]
           assert callable
           try:
->             func(*args[1:], **kwargs)
               #del __traceback__
           except ExpectedException:
               return py.code.ExceptionInfo()
           k = ", ".join(["%s=%r" % x for x in kwargs.items()])
           if k:
               k = ', ' + k
           expr = '%s(%r%s)' %(func.__name__, args, k)
       raise ExceptionFailure(msg="DID NOT RAISE", 
                              expr=args, expected=ExpectedException) 
test/rsession/hostmanage.py - line 57
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
   def initgateway(self, python="python"):
       if self.hostname == "localhost":
           self.gw = py.execnet.PopenGateway(python=python)
       else:
           self.gw = py.execnet.SshGateway(self.hostname, 
                                           remotepython=python)
       if self.inplacelocal:
           self.gw.remote_exec(py.code.Source(
               sethomedir, "sethomedir()"
           )).waitclose()
           self.gw_remotepath = None
       else:
           assert self.relpath
           channel = self.gw.remote_exec(py.code.Source(
               gethomedir,
               sethomedir, "sethomedir()", 
               getpath_relto_home, """
                   channel.send(getpath_relto_home(%r))
->             """ % self.relpath,
           ))
           self.gw_remotepath = channel.receive()
execnet/gateway.py - line 285
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
   def remote_exec(self, source, stdout=None, stderr=None): 
       """ return channel object and connect it to a remote
               execution thread where the given 'source' executes
               and has the sister 'channel' object in its global 
               namespace.  The callback functions 'stdout' and 
               'stderr' get called on receival of remote 
               stdout/stderr output strings. 
           """
       try:
           source = str(Source(source))
       except NameError: 
           try: 
               import py 
               source = str(py.code.Source(source))
           except ImportError: 
               pass 
->     channel = self.newchannel() 
       outid = self._newredirectchannelid(stdout) 
       errid = self._newredirectchannelid(stderr) 
       self._send(Message.CHANNEL_OPEN(
                   channel.id, (source, outid, errid)))
       return channel 
execnet/gateway.py - line 267
265
266
267
   def newchannel(self): 
       """ return new channel object.  """ 
->     return self._channelfactory.new()
execnet/channel.py - line 211
206
207
208
209
210
211
212
213
214
215
216
217
218
219
   def new(self, id=None):
       """ create a new Channel with 'id' (or create new id if None). """
       self._writelock.acquire()
       try:
           if self.finished:
->             raise IOError("connexion already closed: %s" % (self.gateway,))
           if id is None:
               id = self.count
               self.count += 2
           channel = Channel(self.gateway, id)
           self._channels[id] = channel
           return channel
       finally:
           self._writelock.release()