call site 0 for test.broken.__repr__
test/testing/test_session.py - line 332
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
   def test_skip_reasons():
       tmp = py.test.ensuretemp("check_skip_reasons")
       tmp.ensure("test_one.py").write(py.code.Source("""
           import py
           def test_1():
               py.test.skip(py.test.broken('stuff'))
           
           def test_2():
               py.test.skip(py.test.notimplemented('stuff'))
       """))
       tmp.ensure("__init__.py")
       config = py.test.config._reparse([tmp])
       session = config.initsession()
->     session.main()
       skips = session.getitemoutcomepairs(Skipped)
       assert len(skips) == 2
       assert repr(skips[0][1]) == 'Broken: stuff'
       assert repr(skips[1][1]) == 'Not implemented: stuff'
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 162
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 239
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
   def skippedreasons(self):
       texts = {}
       for colitem, outcome in self.getitemoutcomepairs(Skipped):
           raisingtb = self.getlastvisible(outcome.excinfo.traceback) 
           fn = raisingtb.frame.code.path
           lineno = raisingtb.lineno
->         d = texts.setdefault(outcome.excinfo.exconly(), {})
           d[(fn,lineno)] = outcome 
                   
       if texts:
           self.out.line()
           self.out.sep('_', 'reasons for skipped tests')
           for text, dict in texts.items():
               for (fn, lineno), outcome in dict.items(): 
                   self.out.line('Skipped in %s:%d' %(fn, lineno+1))
               self.out.line("reason: %s" % text) 
               self.out.line()
code/excinfo.py - line 32
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
   def exconly(self, tryshort=False): 
       """ return the exception as a string
           
               when 'tryshort' resolves to True, and the exception is a
               py.magic.AssertionError, only the actual exception part of
               the exception representation is returned (so 'AssertionError: ' is
               removed from the beginning)
           """
->     lines = py.std.traceback.format_exception_only(self.type, self.value)
       text = ''.join(lines)
       if text.endswith('\n'):
           text = text[:-1]
       if tryshort: 
           if text.startswith(self._striptext): 
               text = text[len(self._striptext):]
       return text
/usr/lib/python2.6/traceback.py - line 179
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
   def format_exception_only(etype, value):
       """Format the exception part of a traceback.
   
       The arguments are the exception type and value such as given by
       sys.last_type and sys.last_value. The return value is a list of
       strings, each ending in a newline.
   
       Normally, the list contains a single string; however, for
       SyntaxError exceptions, it contains several lines that (when
       printed) display detailed information about where the syntax
       error occurred.
   
       The message indicating which exception occurred is always the last
       string in the list.
   
       """
   
       # An instance should not have a meaningful value parameter, but
       # sometimes does, particularly for string exceptions, such as
       # >>> raise string1, string2  # deprecated
       #
       # Clear these out first because issubtype(string1, SyntaxError)
       # would throw another exception and mask the original problem.
       if (isinstance(etype, BaseException) or
           isinstance(etype, types.InstanceType) or
           etype is None or type(etype) is str):
           return [_format_final_exc_line(etype, value)]
   
       stype = etype.__name__
   
       if not issubclass(etype, SyntaxError):
->         return [_format_final_exc_line(stype, value)]
   
       # It was a syntax error; show exactly where the problem was found.
       lines = []
       try:
           msg, (filename, lineno, offset, badline) = value.args
       except Exception:
           pass
       else:
           filename = filename or "<string>"
           lines.append('  File "%s", line %d\n' % (filename, lineno))
           if badline is not None:
               lines.append('    %s\n' % badline.strip())
               if offset is not None:
                   caretspace = badline[:offset].lstrip()
                   # non-space whitespace (likes tabs) must be kept for alignment
                   caretspace = ((c.isspace() and c or ' ') for c in caretspace)
                   # only three spaces to account for offset1 == pos 0
                   lines.append('   %s^\n' % ''.join(caretspace))
               value = msg
   
       lines.append(_format_final_exc_line(stype, value))
       return lines
/usr/lib/python2.6/traceback.py - line 205
203
204
205
206
207
208
209
210
   def _format_final_exc_line(etype, value):
       """Return a list of a single line -- normal case for format_exception_only"""
->     valuestr = _some_str(value)
       if value is None or not valuestr:
           line = "%s\n" % etype
       else:
           line = "%s: %s\n" % (etype, valuestr)
       return line
/usr/lib/python2.6/traceback.py - line 214
212
213
214
215
216
   def _some_str(value):
       try:
->         return str(value)
       except:
           return '<unprintable %s object>' % type(value).__name__
test/outcome.py - line 12
10
11
12
13
   def __repr__(self):
       if self.msg: 
->         return repr(self.msg) 
       return "<%s instance>" %(self.__class__.__name__,)