Rev4104, Don't start blocking Noparallel calls in separate greenlet to be able to catch exceptions.

This commit is contained in:
shortcutme 2019-06-11 17:04:37 +02:00
parent eeef6fe65f
commit 862e19a263
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
3 changed files with 62 additions and 10 deletions

View file

@ -1,8 +1,9 @@
import time
import util
import gevent
import pytest
import util
class ExampleClass(object):
def __init__(self):
@ -120,3 +121,12 @@ class TestNoparallel:
taken = time.time() - s
assert 1.2 > taken >= 1.0 # 2 * 0.5s count = ~1s
def testException(self):
@util.Noparallel()
def raiseException():
raise Exception("Test error!")
with pytest.raises(Exception) as err:
raiseException()
assert str(err) == "Test error!"