Use shorter 'if kwargs' check as requested during review

This commit is contained in:
Bruno Oliveira 2018-03-28 07:30:14 -03:00 committed by GitHub
parent a5d9fbe2b0
commit bfe773bfc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)