We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert
pytest.raises
There is impossible to validate correctness of custom exception.
I propose to allow assert statement to use variable outside context manager.
with pytest.raises(CustomError) as exc_info: client.send_sms(sms) assert exc_info.value.http_status == expected_status assert exc_info.value.description == expected_description
Code above raise an error:
148:16 WPS441 Found control variable used after block: exc_info assert exc_info.value.http_status == expected_status
It is typical use case for pytest.
The text was updated successfully, but these errors were encountered:
@sobolevn what is your opinion on this issue?
Sorry, something went wrong.
No branches or pull requests
Rule request
There is impossible to validate correctness of custom exception.
Thesis
I propose to allow
assert
statement to use variable outside context manager.Code above raise an error:
Reasoning
It is typical use case for pytest.
The text was updated successfully, but these errors were encountered: