call site 3 for test.collect.Function.startcapture
test/rsession/testing/test_slave.py - line 38
35
36
37
38
39
40
41
42
43
44
45
46
47
48
   def test_slave_run_failing(self):
       node = self.gettestnode()
       item = self.getexample("fail") 
->     outcome = node.execute(item._get_collector_trail())
       assert not outcome.passed 
       assert not outcome.setupfailure 
       assert len(outcome.excinfo.traceback) == 1
       assert outcome.excinfo.traceback[-1].frame.code.name == 'funcfail'
   
       ser = outcome.make_repr()
       reproutcome = ReprOutcome(ser) 
       assert not reproutcome.passed 
       assert not reproutcome.setupfailure 
       assert reproutcome.excinfo
test/rsession/slave.py - line 21
18
19
20
21
   def execute(self, itemspec):
       item = self.config._getcollector(itemspec)
       ex = self.executor(item, config=self.config)
->     return ex.execute()
test/rsession/executor.py - line 35
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
   def execute(self, capture=True):
       try:
->         self.run(capture)
           outcome = Outcome()
       except Skipped, e: 
           outcome = Outcome(skipped=str(e))
       except (SystemExit, KeyboardInterrupt):
           raise
       except:
           e = sys.exc_info()[1]
           if isinstance(e, Failed) and e.excinfo:
               excinfo = e.excinfo
           else:
               excinfo = py.code.ExceptionInfo()
               if isinstance(self.item, py.test.collect.Function): 
                   fun = self.item.obj # hope this is stable 
                   code = py.code.Code(fun)
                   excinfo.traceback = excinfo.traceback.cut(
                       path=code.path, firstlineno=code.firstlineno)
           outcome = Outcome(excinfo=excinfo, setupfailure=False)
           if self.usepdb:
               if self.reporter is not None:
                   self.reporter(repevent.ImmediateFailure(self.item,
                       ReprOutcome(outcome.make_repr
                                   (self.config.option.tbstyle))))
               import pdb
               pdb.post_mortem(excinfo._excinfo[2])
               # XXX hmm, we probably will not like to continue from that
               #     point
               raise SystemExit()
       outcome.stdout, outcome.stderr = self.item._getouterr()
       return outcome
test/rsession/executor.py - line 25
23
24
25
26
27
28
29
30
31
   def run(self, capture=True):
       if capture:
->         self.item.startcapture()
           try:
               self.item.run()
           finally:
               self.item.finishcapture()
       else:
           self.item.run()