Commit 8e62b010 authored by Denis Bilenko's avatar Denis Bilenko

add test__real_greenlet.py

parent 5deb683d
"""Testing that greenlet restores sys.exc_info.
Passes with CPython + greenlet 0.4.0
Fails with PyPy 2.2.1
"""
import sys
import greenlet
print ('Your greenlet version: %s' % (getattr(greenlet, '__version__', None), ))
result = []
def func():
result.append(repr(sys.exc_info()))
g = greenlet.greenlet(func)
try:
1 / 0
except ZeroDivisionError:
g.switch()
assert result == ['(None, None, None)'], result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment