call site 3 for test.collect.Module.listnames
test/rsession/testing/test_reporter.py - line 185
183
184
185
186
187
188
189
190
   def test_full_module(self):
       #py.test.skip("XXX rewrite test to not rely on exact formatting")
->     received = self._test_full_module()
       expected = """
   repmod/test_one.py[1] 
   repmod/test_three.py[0] - FAILED TO LOAD MODULE
   repmod/test_two.py[0] - skipped (reason)"""
       assert received.find(expected) != -1 
test/rsession/testing/test_reporter.py - line 118
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
   def _test_full_module(self):
       tmpdir = py.test.ensuretemp("repmod")
       tmpdir.ensure("__init__.py")
       tmpdir.ensure("test_one.py").write(py.code.Source("""
           def test_x():
               pass
           """))
       tmpdir.ensure("test_two.py").write(py.code.Source("""
           import py
           py.test.skip("reason")
           """))
       tmpdir.ensure("test_three.py").write(py.code.Source("""
           sadsadsa
           """))
           
       def boxfun():
           config = py.test.config._reparse([str(tmpdir)])
           rootcol = py.test.collect.Directory(tmpdir)
           hosts = [HostInfo('localhost')]
           r = self.reporter(config, hosts)
           list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x)))
   
       cap = py.io.StdCaptureFD()
->     boxfun()
       out, err = cap.reset()
       assert not err
       return out
test/rsession/testing/test_reporter.py - line 115
110
111
112
113
114
115
   def boxfun():
       config = py.test.config._reparse([str(tmpdir)])
       rootcol = py.test.collect.Directory(tmpdir)
       hosts = [HostInfo('localhost')]
       r = self.reporter(config, hosts)
->     list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x)))
test/collect.py - line 217
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
   def _tryiter(self, yieldtype=None, reporterror=None, keyword=None):
       """ yield stop item instances from flattening the collector. 
               XXX deprecated: this way of iteration is not safe in all
               cases. 
           """ 
       if yieldtype is None: 
           yieldtype = py.test.collect.Item 
       if isinstance(self, yieldtype):
           try:
               self._skipbykeyword(keyword)
               yield self
           except Skipped:
               if reporterror is not None:
                   excinfo = py.code.ExceptionInfo()
                   reporterror((excinfo, self))
       else:
           if not isinstance(self, py.test.collect.Item):
               try:
                   if reporterror is not None:
                       reporterror((None, self))
                   for x in self.run(): 
                       for y in self.join(x)._tryiter(yieldtype, 
->                                         reporterror, keyword): 
                           yield y
               except KeyboardInterrupt:
                   raise
               except: 
                   if reporterror is not None: 
                       excinfo = py.code.ExceptionInfo()
                       reporterror((excinfo, self)) 
test/collect.py - line 214
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
   def _tryiter(self, yieldtype=None, reporterror=None, keyword=None):
       """ yield stop item instances from flattening the collector. 
               XXX deprecated: this way of iteration is not safe in all
               cases. 
           """ 
       if yieldtype is None: 
           yieldtype = py.test.collect.Item 
       if isinstance(self, yieldtype):
           try:
               self._skipbykeyword(keyword)
               yield self
           except Skipped:
               if reporterror is not None:
                   excinfo = py.code.ExceptionInfo()
                   reporterror((excinfo, self))
       else:
           if not isinstance(self, py.test.collect.Item):
               try:
                   if reporterror is not None:
->                     reporterror((None, self))
                   for x in self.run(): 
                       for y in self.join(x)._tryiter(yieldtype, 
                                           reporterror, keyword): 
                           yield y
               except KeyboardInterrupt:
                   raise
               except: 
                   if reporterror is not None: 
                       excinfo = py.code.ExceptionInfo()
                       reporterror((excinfo, self)) 
test/rsession/testing/test_reporter.py - line 115
115
-> list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x)))
test/rsession/rsession.py - line 75
72
73
74
75
76
77
78
79
   def reporterror(reporter, data):
       excinfo, item = data
       if excinfo is None:
->         reporter(repevent.ItemStart(item))
       elif excinfo.type is Skipped:
           reporter(repevent.SkippedTryiter(excinfo, item))
       else:
           reporter(repevent.FailedTryiter(excinfo, item))
test/rsession/reporter.py - line 38
34
35
36
37
38
39
40
41
42
43
44
45
46
   def report(self, what):
       repfun = getattr(self, "report_" + what.__class__.__name__, 
                        self.report_unknown)
       try:
->         return repfun(what)
       except (KeyboardInterrupt, SystemExit):
           raise
       except:
           print "Internal reporting problem"
           excinfo = py.code.ExceptionInfo()
           for i in excinfo.traceback:
               print str(i)[2:-1]
           print excinfo
test/rsession/reporter.py - line 320
319
320
   def report_ItemStart(self, event):
->     self.show_item(event.item)
test/rsession/reporter.py - line 330
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
   def show_item(self, item, count_elems = True):
       if isinstance(item, py.test.collect.Module):
           # XXX This is a terrible hack, I don't like it
           #     and will rewrite it at some point
           #self.count = 0
           lgt = len(list(item._tryiter()))
           #self.lgt = lgt
           # print names relative to current workdir
->         name = "/".join(item.listnames())
           local = str(py.path.local())
           d = str(self.config.topdir)
           if local.startswith(d):
               local = local[len(d) + 1:]
           if local and name.startswith(local):
               name = name[len(local) + 1:]
           self.out.write("\n%s[%d] " % (name, lgt))