call site 0 for code.Source.__getitem__
test/rsession/testing/test_master.py - line 68
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
   def test_masternode():
       try:
           raise ValueError()
       except ValueError:
           excinfo = py.code.ExceptionInfo()
       
       ch = DummyChannel()
       reportlist = []
       mnode = MasterNode(ch, reportlist.append)
       mnode.send(Item("ok"))
       mnode.send(Item("notok"))
       ch.callback(Outcome().make_repr())
->     ch.callback(Outcome(excinfo=excinfo).make_repr())
       assert len(reportlist) == 4
       received = [i for i in reportlist 
           if isinstance(i, repevent.ReceivedItemOutcome)]
       assert received[0].outcome.passed 
       assert not received[1].outcome.passed 
test/rsession/outcome.py - line 65
63
64
65
66
   def make_repr(self, tbstyle="long"):
       return (self.passed, self.setupfailure, 
->             self.make_excinfo_repr(tbstyle), 
               self.skipped, self.is_critical, 0, self.stdout, self.stderr)
test/rsession/outcome.py - line 30
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
   def make_excinfo_repr(self, tbstyle):
       if self.excinfo is None:
           return None
       excinfo = self.excinfo
       tb_info = [self.traceback_entry_repr(x, tbstyle)
->                for x in excinfo.traceback]
       rec_index = excinfo.traceback.recursionindex()
       if hasattr(excinfo, 'type'):
           etype = excinfo.type
           if hasattr(etype, '__name__'):
               etype = etype.__name__
       else:
           etype = excinfo.typename
       val = getattr(excinfo, 'value', None)
       if not val:
           val = excinfo.exconly()
       val = str(val)
       return (etype, val, (tb_info, rec_index))
test/rsession/outcome.py - line 51
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
   def traceback_entry_repr(self, tb_entry, tb_style):
       lineno = tb_entry.lineno
       relline = lineno - tb_entry.frame.code.firstlineno
       path = str(tb_entry.path)
       #try:
       try:
           if tb_style == 'long':
->             source = str(tb_entry.getsource())
           else:
               source = str(tb_entry.getsource()).split("\n")[relline]
       except py.error.ENOENT:
           source = "[cannot get source]"
       name = str(tb_entry.frame.code.name)
       # XXX: Bare except. What can getsource() raise anyway?
       # SyntaxError, AttributeError, IndentationError for sure, check it
       #except:
       #    source = "<could not get source>"
       return (relline, lineno, source, path, name)
code/traceback2.py - line 66
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
   def getsource(self): 
       """ return failing source code. """ 
       source = self.frame.code.fullsource
       start = self.getfirstlinesource()
       end = self.lineno
       try:
           _, end = source.getstatementrange(end) 
       except IndexError: 
           end = self.lineno + 1 
       # heuristic to stop displaying source on e.g. 
       #   if something:  # assume this causes a NameError
       #      # _this_ lines and the one 
              #        below we don't want from entry.getsource() 
       for i in range(self.lineno, end): 
->         if source[i].rstrip().endswith(':'): 
               end = i + 1
               break 
       return source[start:end]