call site 7 for test.collect.Module.listnames
test/rsession/testing/test_reporter.py - line 140
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
   def test_failed_to_load(self):
       tmpdir = py.test.ensuretemp("failedtoload")
       tmpdir.ensure("__init__.py")
       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)
           host = HostInfo('localhost')
           r = self.reporter(config, [host])
           r.report(repevent.TestStarted([host], config.topdir, ["a"]))
           r.report(repevent.RsyncFinished())
           list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x)))
           r.report(repevent.TestFinished())
           return r
           
       cap = py.io.StdCaptureFD()
->     r = boxfun()
       out, err = cap.reset()
       assert not err
       assert out.find("1 failed in") != -1
       assert out.find("NameError: name 'sadsadsa' is not defined") != -1
test/rsession/testing/test_reporter.py - line 135
128
129
130
131
132
133
134
135
136
137
   def boxfun():
       config = py.test.config._reparse([str(tmpdir)])
       rootcol = py.test.collect.Directory(tmpdir)
       host = HostInfo('localhost')
       r = self.reporter(config, [host])
       r.report(repevent.TestStarted([host], config.topdir, ["a"]))
       r.report(repevent.RsyncFinished())
->     list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x)))
       r.report(repevent.TestFinished())
       return r
test/collect.py - line 214
192
193
194
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
   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 221
192
193
194
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
   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 135
135
-> list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x)))
test/rsession/rsession.py - line 79
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 39
35
36
37
38
39
40
41
42
43
44
45
46
47
   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 282
281
282
283
284
285
   def report_FailedTryiter(self, event):
->     self.out.line("FAILED TO LOAD MODULE: %s\n" % "/".join(event.item.listnames()))
       self.failed_tests_outcome.append(event)
       # argh! bad hack, need to fix it
       self.failed[self.hosts[0]] += 1