| 72 |
| 73 |
| 74 |
| 75 |
| 76 |
| 77 |
| 78 |
| 79 |
| 80 |
| 81 |
| 82 |
| 83 |
| 84 |
| 85 |
| 86 |
| 87 |
| 88 | |
def test_traceback_entry_getsource_in_construct(self): |
source = py.code.Source("""\ |
def xyz(): |
try: |
raise ValueError |
except somenoname: |
pass |
xyz() |
""") |
try: |
exec source.compile() |
except NameError: |
tb = py.code.ExceptionInfo().traceback |
print tb[-1].getsource() |
-> s = str(tb[-1].getsource()) |
assert s.startswith("def xyz():\n try:") |
assert s.endswith("except somenoname:") | |