summaryrefslogtreecommitdiff
path: root/_pytest
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2018-03-28 07:30:14 -0300
committerGitHub <noreply@github.com>2018-03-28 07:30:14 -0300
commitbfe773bfc8a37981faec2c27ea3ba65aa04f5c5d (patch)
tree38ce380a1df83f516ddda1de6109295435095fe0 /_pytest
parenta5d9fbe2b0d14a84325e87629a785eda72f7d9f4 (diff)
downloadpytest-bfe773bfc8a37981faec2c27ea3ba65aa04f5c5d.tar.gz
Use shorter 'if kwargs' check as requested during review
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/python_api.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/_pytest/python_api.py b/_pytest/python_api.py
index 5e4776ce3..0b30b7ac8 100644
--- a/_pytest/python_api.py
+++ b/_pytest/python_api.py
@@ -597,7 +597,7 @@ def raises(expected_exception, *args, **kwargs):
message = kwargs.pop("message")
if "match" in kwargs:
match_expr = kwargs.pop("match")
- if len(kwargs.keys()) > 0:
+ if kwargs:
msg = 'Unexpected keyword arguments passed to pytest.raises: '
msg += ', '.join(kwargs.keys())
raise TypeError(msg)