call site 0 for code.Frame.is_true
code/testing/test_source.py - line 196
192
193
194
195
196
197
198
199
200
   def test_compile_and_getsource(self):
       co = self.source.compile()
       exec co
       f(7)
->     excinfo = py.test.raises(AssertionError, "f(6)")
       frame = excinfo.traceback[-1].frame 
       stmt = frame.code.fullsource.getstatement(frame.lineno)
       #print "block", str(block)
       assert str(stmt).strip().startswith('assert')
test/raises.py - line 20
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
   def raises(ExpectedException, *args, **kwargs):
       """ raise AssertionError, if target code does not raise the expected
           exception.
       """
       assert args
       __tracebackhide__ = True 
       if isinstance(args[0], str):
           expr, = args
           assert isinstance(expr, str)
           frame = sys._getframe(1)
           loc = frame.f_locals.copy()
           loc.update(kwargs)
           #print "raises frame scope: %r" % frame.f_locals
           source = py.code.Source(expr)
           try:
->             exec source.compile() in frame.f_globals, loc
               #del __traceback__
               # XXX didn'T mean f_globals == f_locals something special?
               #     this is destroyed here ...
           except ExpectedException:
               return py.code.ExceptionInfo()
       else:
           func = args[0]
           assert callable
           try:
               func(*args[1:], **kwargs)
               #del __traceback__
           except ExpectedException:
               return py.code.ExceptionInfo()
           k = ", ".join(["%s=%r" % x for x in kwargs.items()])
           if k:
               k = ', ' + k
           expr = '%s(%r%s)' %(func.__name__, args, k)
       raise ExceptionFailure(msg="DID NOT RAISE", 
                              expr=args, expected=ExpectedException) 
None</build/buildd/codespeak-lib-0.9.1/py/test/raises.py:20> - line 1
1
-> f(6)
None</build/buildd/codespeak-lib-0.9.1/py/code/testing/test_source.py:193> - line 4
1
2
3
4
   def f(x):
       assert (x ==
               3 +
->             4)
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 339
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)