summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorJeffrey Rackauckas <jeffreyrack@gmail.com>2018-03-27 19:57:15 -0700
committerJeffrey Rackauckas <jeffreyrack@gmail.com>2018-03-27 19:57:15 -0700
commit34afded06dbcc4a2615043c3deaea64511d4287d (patch)
tree0fac56770a4908f04edd4c6aa72a5daadea168ca /testing
parentff3d13ed0efab6692a07059b1d61c53eec6e0412 (diff)
downloadpytest-34afded06dbcc4a2615043c3deaea64511d4287d.tar.gz
Update pytest.raises to raise a TypeError when an invalid keyword argument is passed.
Diffstat (limited to 'testing')
-rw-r--r--testing/python/raises.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/testing/python/raises.py b/testing/python/raises.py
index 183259f6b..156319816 100644
--- a/testing/python/raises.py
+++ b/testing/python/raises.py
@@ -61,6 +61,11 @@ class TestRaises(object):
with pytest.raises(TypeError):
pytest.raises('wrong', lambda: None)
+ def test_invalid_arguments_to_raises(self):
+ with pytest.raises(TypeError, match='unknown'):
+ with pytest.raises(TypeError, unknown='bogus'):
+ raise ValueError()
+
def test_tuple(self):
with pytest.raises((KeyError, ValueError)):
raise KeyError('oops')