Use pytest.raises() instead of try/catch with asser 0
This is somehow more readable, and enable using the features of pytest's ExeptionInfo (such as errisinstance).
This commit is contained in:
parent
e7d548595e
commit
4dc2ef19ea
5 changed files with 39 additions and 84 deletions
|
|
@ -140,12 +140,8 @@ def test_manual_context_binding():
|
|||
ctx.push()
|
||||
assert index() == 'Hello World!'
|
||||
ctx.pop()
|
||||
try:
|
||||
with pytest.raises(RuntimeError):
|
||||
index()
|
||||
except RuntimeError:
|
||||
pass
|
||||
else:
|
||||
assert 0, 'expected runtime error'
|
||||
|
||||
@pytest.mark.skipif(greenlet is None, reason='greenlet not installed')
|
||||
def test_greenlet_context_copying():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue