call site 1 for code.Source.strip
test/rsession/testing/test_reporter.py - line 140
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
   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())
           
       cap = py.io.StdCaptureFD()
->     boxfun()
       out, err = cap.reset()
       assert not err
       assert out.find("NameError: name 'sadsadsa' is not defined") != -1
test/rsession/testing/test_reporter.py - line 137
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())
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 117
112
113
114
115
116
117
118
119
120
121
   def report_TestFinished(self, item):
       self.out.line()
       assert hasattr(self, 'timestart')
       self.timeend = item.timeend
       self.skips()
->     self.failures()
       if hasattr(self, 'nodes'): # XXX: Testing
           self.hangs()
       self.summary()
       return len(self.failed_tests_outcome) > 0
test/rsession/reporter.py - line 155
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
   def failures(self):
       if self.failed_tests_outcome:
           self.out.sep("=", " FAILURES ")
       for event in self.failed_tests_outcome:
           if isinstance(event, repevent.ReceivedItemOutcome):
               host = self.gethost(event)
               self.out.sep('_', "%s on %s" % 
                   (" ".join(event.item.listnames()), host))
               if event.outcome.signal:
                   self.presenter.repr_item_info(event.item)
                   self.repr_signal(event.item, event.outcome)
               else:
                   self.repr_failure(event.item, event.outcome)
           else:
               self.out.sep('_', " ".join(event.item.listnames()))
               out = outcome.Outcome(excinfo=event.excinfo)
->             self.repr_failure(event.item, outcome.ReprOutcome(out.make_repr()))
test/rsession/reporter.py - line 168
160
161
162
163
164
165
166
167
168
   def repr_failure(self, item, outcome):
       excinfo = outcome.excinfo
       traceback = excinfo.traceback
       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(outcome))
test/representation.py - line 110
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
122
123
124
125
126
127
128
129
130
131
   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 74
72
73
74
75
76
77
   def getentrysource(self, entry):
       try:
->         source = entry.getsource()
       except py.error.ENOENT:
           source = py.code.Source("[failure to get at sourcelines from %r]\n" % entry)
       return source.deindent()
test/rsession/outcome.py - line 80
79
80
   def getsource(self):
->     return py.code.Source(self.source).strip()