call site 0 for code.Frame.is_true
doc/example/pytest/test_failures.py - line 9
6
7
8
9
10
11
12
13
   def test_failure_demo_fails_properly(): 
       config = py.test.config._reparse([failure_demo]) 
       session = config.initsession()
->     session.main()
       l = session.getitemoutcomepairs(Failed)
       assert len(l) == 21 
       l = session.getitemoutcomepairs(Passed)
       assert not l 
test/session.py - line 63
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/session.py - line 84
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
   def runtraced(self, colitem):
       if self.shouldclose(): 
           raise Exit, "received external close signal" 
   
       outcome = None 
       colitem.startcapture() 
       try: 
           self.start(colitem)
           try: 
               try:
                   if colitem._stickyfailure: 
                       raise colitem._stickyfailure 
->                 outcome = self.run(colitem) 
               except (KeyboardInterrupt, Exit): 
                   raise 
               except Outcome, outcome: 
                   if outcome.excinfo is None: 
                       outcome.excinfo = py.code.ExceptionInfo() 
               except: 
                   excinfo = py.code.ExceptionInfo() 
                   outcome = Failed(excinfo=excinfo) 
               assert (outcome is None or 
                       isinstance(outcome, (list, Outcome)))
           finally: 
               self.finish(colitem, outcome) 
           if isinstance(outcome, Failed) and self.config.option.exitfirst:
               py.test.exit("exit on first problem configured.", item=colitem)
       finally: 
           colitem.finishcapture()
test/session.py - line 119
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
   def run(self, colitem): 
       if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
           return 
       if isinstance(colitem, py.test.collect.Item): 
           colitem._skipbykeyword(self.config.option.keyword)
       res = colitem.run() 
       if res is None: 
           return Passed() 
       elif not isinstance(res, (list, tuple)): 
           raise TypeError("%r.run() returned neither "
                           "list, tuple nor None: %r" % (colitem, res))
       else: 
           finish = self.startiteration(colitem, res)
           try: 
               for name in res: 
                   obj = colitem.join(name) 
                   assert obj is not None 
->                 self.runtraced(obj) 
           finally: 
               if finish: 
                   finish() 
       return res 
test/session.py - line 84
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
   def runtraced(self, colitem):
       if self.shouldclose(): 
           raise Exit, "received external close signal" 
   
       outcome = None 
       colitem.startcapture() 
       try: 
           self.start(colitem)
           try: 
               try:
                   if colitem._stickyfailure: 
                       raise colitem._stickyfailure 
->                 outcome = self.run(colitem) 
               except (KeyboardInterrupt, Exit): 
                   raise 
               except Outcome, outcome: 
                   if outcome.excinfo is None: 
                       outcome.excinfo = py.code.ExceptionInfo() 
               except: 
                   excinfo = py.code.ExceptionInfo() 
                   outcome = Failed(excinfo=excinfo) 
               assert (outcome is None or 
                       isinstance(outcome, (list, Outcome)))
           finally: 
               self.finish(colitem, outcome) 
           if isinstance(outcome, Failed) and self.config.option.exitfirst:
               py.test.exit("exit on first problem configured.", item=colitem)
       finally: 
           colitem.finishcapture()
test/session.py - line 119
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
   def run(self, colitem): 
       if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
           return 
       if isinstance(colitem, py.test.collect.Item): 
           colitem._skipbykeyword(self.config.option.keyword)
       res = colitem.run() 
       if res is None: 
           return Passed() 
       elif not isinstance(res, (list, tuple)): 
           raise TypeError("%r.run() returned neither "
                           "list, tuple nor None: %r" % (colitem, res))
       else: 
           finish = self.startiteration(colitem, res)
           try: 
               for name in res: 
                   obj = colitem.join(name) 
                   assert obj is not None 
->                 self.runtraced(obj) 
           finally: 
               if finish: 
                   finish() 
       return res 
test/session.py - line 84
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
   def runtraced(self, colitem):
       if self.shouldclose(): 
           raise Exit, "received external close signal" 
   
       outcome = None 
       colitem.startcapture() 
       try: 
           self.start(colitem)
           try: 
               try:
                   if colitem._stickyfailure: 
                       raise colitem._stickyfailure 
->                 outcome = self.run(colitem) 
               except (KeyboardInterrupt, Exit): 
                   raise 
               except Outcome, outcome: 
                   if outcome.excinfo is None: 
                       outcome.excinfo = py.code.ExceptionInfo() 
               except: 
                   excinfo = py.code.ExceptionInfo() 
                   outcome = Failed(excinfo=excinfo) 
               assert (outcome is None or 
                       isinstance(outcome, (list, Outcome)))
           finally: 
               self.finish(colitem, outcome) 
           if isinstance(outcome, Failed) and self.config.option.exitfirst:
               py.test.exit("exit on first problem configured.", item=colitem)
       finally: 
           colitem.finishcapture()
test/session.py - line 119
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
   def run(self, colitem): 
       if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
           return 
       if isinstance(colitem, py.test.collect.Item): 
           colitem._skipbykeyword(self.config.option.keyword)
       res = colitem.run() 
       if res is None: 
           return Passed() 
       elif not isinstance(res, (list, tuple)): 
           raise TypeError("%r.run() returned neither "
                           "list, tuple nor None: %r" % (colitem, res))
       else: 
           finish = self.startiteration(colitem, res)
           try: 
               for name in res: 
                   obj = colitem.join(name) 
                   assert obj is not None 
->                 self.runtraced(obj) 
           finally: 
               if finish: 
                   finish() 
       return res 
test/session.py - line 84
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
   def runtraced(self, colitem):
       if self.shouldclose(): 
           raise Exit, "received external close signal" 
   
       outcome = None 
       colitem.startcapture() 
       try: 
           self.start(colitem)
           try: 
               try:
                   if colitem._stickyfailure: 
                       raise colitem._stickyfailure 
->                 outcome = self.run(colitem) 
               except (KeyboardInterrupt, Exit): 
                   raise 
               except Outcome, outcome: 
                   if outcome.excinfo is None: 
                       outcome.excinfo = py.code.ExceptionInfo() 
               except: 
                   excinfo = py.code.ExceptionInfo() 
                   outcome = Failed(excinfo=excinfo) 
               assert (outcome is None or 
                       isinstance(outcome, (list, Outcome)))
           finally: 
               self.finish(colitem, outcome) 
           if isinstance(outcome, Failed) and self.config.option.exitfirst:
               py.test.exit("exit on first problem configured.", item=colitem)
       finally: 
           colitem.finishcapture()
test/session.py - line 107
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
   def run(self, colitem): 
       if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item): 
           return 
       if isinstance(colitem, py.test.collect.Item): 
           colitem._skipbykeyword(self.config.option.keyword)
->     res = colitem.run() 
       if res is None: 
           return Passed() 
       elif not isinstance(res, (list, tuple)): 
           raise TypeError("%r.run() returned neither "
                           "list, tuple nor None: %r" % (colitem, res))
       else: 
           finish = self.startiteration(colitem, res)
           try: 
               for name in res: 
                   obj = colitem.join(name) 
                   assert obj is not None 
                   self.runtraced(obj) 
           finally: 
               if finish: 
                   finish() 
       return res 
test/item.py - line 64
61
62
63
64
   def run(self):
       """ setup and execute the underlying test function. """
       self._state.prepare(self) 
->     self.execute(self.obj, *self._args)
test/item.py - line 68
66
67
68
   def execute(self, target, *args):
       """ execute the given test function. """
->     target(*args)
doc/example/pytest/failure_demo.py - line 21
15
16
17
18
19
20
21
   def test_simple(self):
       def f():
           return 42
       def g():
           return 43
   
->     assert f() == g()
magic/assertion.py - line 22
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
   def __init__(self, *args):
       BuiltinAssertionError.__init__(self, *args)
       if args: 
           self.msg = str(args[0])
       else: 
           f = sys._getframe(1)
           try:
               source = py.code.Frame(f).statement
               source = str(source.deindent()).strip()
           except py.error.ENOENT:
               source = None
               # this can also occur during reinterpretation, when the
               # co_filename is set to "<run>".
           if source:
->             self.msg = exprinfo.interpret(source, f, should_fail=True)
               if not self.args:
                   self.args = (self.msg,)
           else:
               self.msg = None
magic/exprinfo.py - line 422
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
   def interpret(source, frame, should_fail=False):
       module = Interpretable(parse(source, 'exec').node)
       #print "got module", module
       if isinstance(frame, py.std.types.FrameType):
           frame = py.code.Frame(frame)
       try:
->         module.run(frame)
       except Failure, e:
           return getfailure(e)
       except passthroughex:
           raise
       except:
           import traceback
           traceback.print_exc()
       if should_fail:
           return "(inconsistently failed then succeeded)"
       else:
           return None
magic/exprinfo.py - line 382
379
380
381
382
   def run(self, frame):
       for stmt in self.nodes:
           stmt = Interpretable(stmt)
->         stmt.run(frame)
magic/exprinfo.py - line 331
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
   def run(self, frame):
       test = Interpretable(self.test)
->     test.eval(frame)
       # simplify 'assert False where False = ...'
       if (test.explanation.startswith('False\n{False = ') and
           test.explanation.endswith('\n}')):
           test.explanation = test.explanation[15:-2]
       # print the result as  'assert <explanation>'
       self.result = test.result
       self.explanation = 'assert ' + test.explanation
       if not frame.is_true(test.result):
           try:
               raise BuiltinAssertionError
           except passthroughex:
               raise
           except:
               raise Failure(self)
magic/exprinfo.py - line 138
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
   def eval(self, frame):
       expr = Interpretable(self.expr)
       expr.eval(frame)
       for operation, expr2 in self.ops:
           expr2 = Interpretable(expr2)
           expr2.eval(frame)
           self.explanation = "%s %s %s" % (
               expr.explanation, operation, expr2.explanation)
           co = compile("__exprinfo_left %s __exprinfo_right" % operation,
                        '?', 'eval')
           try:
               self.result = frame.eval(co, __exprinfo_left=expr.result,
                                            __exprinfo_right=expr2.result)
           except passthroughex:
               raise
           except:
               raise Failure(self)
->         if not frame.is_true(self.result):
               break
           expr = expr2