Rule request
There is impossible to validate correctness of custom exception.
Thesis
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
Reasoning
It is typical use case for pytest.
Rule request
There is impossible to validate correctness of custom exception.
Thesis
I propose to allow
assertstatement to use variable outside context manager.Code above raise an error:
Reasoning
It is typical use case for pytest.