From 34afded06dbcc4a2615043c3deaea64511d4287d Mon Sep 17 00:00:00 2001 From: Jeffrey Rackauckas Date: Tue, 27 Mar 2018 19:57:15 -0700 Subject: Update pytest.raises to raise a TypeError when an invalid keyword argument is passed. --- testing/python/raises.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testing') 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') -- cgit v1.2.3