I am trying to conduct a thorough re-examination of the trace and get the actual values ββfrom the objects that do not return more (better?) Information along with the trace.
A random script is a function that I import and execute that looks like this:
def foo(): a = True b = False assert a == b
And it starts as:
from foo import foo def re_inspect(): try: foo() except Exception, e:
When an AssertionError occurs, if I try to evaluate the line in which the exception occurs, I (of course) cannot say that a or b ( NameError immediately occurs) because I lack the code context.
Note that I do not have access to a and b , as the above code is imported and then executed. Since foo does not live in the current namespace, my problem is getting the correct values ββfrom the foo context.
What would be the right approach to be able to say that a and b so that y can safely say something like: "a - Truth is a lie"?
source share