call site 8 for code.Source.__len__
doc/test_conftest.py - line 19
8
9
10
11
12
13
14
15
16
17
18
19
20
21
   def test_doctest_extra_exec(): 
       # XXX get rid of the next line: 
       py.magic.autopath().dirpath('conftest.py').copy(tmpdir.join('conftest.py'))
       xtxt = tmpdir.join('y.txt')
       xtxt.write(py.code.Source("""
           hello::
               .. >>> raise ValueError 
                  >>> None
       """))
       config = py.test.config._reparse([xtxt]) 
       session = config.initsession()
->     session.main()
       l = session.getitemoutcomepairs(Failed) 
       assert len(l) == 1
test/session.py - line 67
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
   def main(self): 
       """ main loop for running tests. """
       colitems = self.config.getcolitems()
       try:
           self.header(colitems) 
           try:
               try:
                   for colitem in colitems: 
                       self.runtraced(colitem)
               except KeyboardInterrupt: 
                   raise 
           finally: 
->             self.footer(colitems) 
       except Exit, ex:
           pass
       return self.getitemoutcomepairs(Failed)
test/terminal/terminal.py - line 163
158
159
160
161
162
163
164
   def footer(self, colitems):
       super(TerminalSession, self).footer(colitems) 
       self.endtime = now()
       self.out.line() 
       self.skippedreasons()
->     self.failures()
       self.summaryline()
test/terminal/terminal.py - line 258
251
252
253
254
255
256
257
258
   def failures(self):
       if self.config.option.tbstyle == 'no':
           return   # skip the detailed failure reports altogether
       l = self.getitemoutcomepairs(Failed)
       if l: 
           self.out.sep('_')
           for colitem, outcome in l: 
->             self.repr_failure(colitem, outcome) 
test/terminal/terminal.py - line 276
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
   def repr_failure(self, item, outcome): 
       excinfo = outcome.excinfo 
       traceback = excinfo.traceback
       #print "repr_failures sees item", item
       #print "repr_failures sees traceback"
       #py.std.pprint.pprint(traceback)
       if item and not self.config.option.fulltrace: 
           path, firstlineno = item._getpathlineno()
           ntraceback = traceback.cut(path=path, firstlineno=firstlineno)
           if ntraceback == traceback:
               ntraceback = ntraceback.cut(path=path)
           traceback = ntraceback.filter()
       if not traceback: 
           self.out.line("empty traceback from item %r" % (item,)) 
           return
       handler = getattr(self.presenter, 'repr_failure_tb%s' % self.config.option.tbstyle)
->     handler(item, excinfo, traceback, lambda : self.repr_out_err(item))
test/representation.py - line 117
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
   def repr_failure_tblong(self, item, excinfo, traceback, out_err_reporter):
       if not self.config.option.nomagic and excinfo.errisinstance(RuntimeError):
           recursionindex = traceback.recursionindex()
       else:
           recursionindex = None
       last = traceback[-1]
       first = traceback[0]
       for index, entry in py.builtin.enumerate(traceback): 
           if entry == first:
               if item: 
                   self.repr_item_info(item) 
                   self.out.line()
           else: 
               self.out.line("")
           source = self.getentrysource(entry)
           firstsourceline = entry.getfirstlinesource()
           marker_location = entry.lineno - firstsourceline
           if entry == last: 
->             self.repr_source(source, 'E', marker_location)
               self.repr_failure_explanation(excinfo, source) 
           else:
               self.repr_source(source, '>', marker_location)
           self.out.line("") 
           self.out.line("[%s:%d]" %(entry.path, entry.lineno+1))
           self.repr_locals(entry.locals)
   
           # trailing info 
           if entry == last:
               out_err_reporter() 
               self.out.sep("_")
           else: 
               self.out.sep("_ ")
               if index == recursionindex:
                   self.out.line("Recursion detected (same locals & position)")
                   self.out.sep("!")
                   break 
test/representation.py - line 33
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
   def repr_source(self, source, marker=">", marker_location=-1):
       """ This one represents piece of source with possible
           marker at requested position
           """
       if isinstance(source, str):
           # why the hell, string is iterable?
           source = source.split("\n")
       if marker_location < 0:
           marker_location += len(source)
           if marker_location < 0:
               marker_location = 0
->     if marker_location >= len(source):
           marker_location = len(source) - 1
       for i in range(len(source)):
           if i == marker_location:
               prefix = marker + "   "
           else:
               prefix = "    "
           self.out.line(prefix + source[i])