Expected exception
Package:
requests
45920

Exception Class:
Exception
Raise code
def test_set_environ_raises_exception():
"""Tests set_environ will raise exceptions in context when the
value parameter is None."""
with pytest.raises(Exception) as exception:
with set_environ('test1', None):
raise Exception('Expected exception')
assert 'Expected exception' in str(exception.value)
Links to the raise (1)
https://github.com/psf/requests/blob/f6d43b03fbb9a1e75ed63a9aa15738a8fce99b50/tests/test_utils.py#L781See also in the other packages (1)
(❌️ No answer)
scrapy/expected-exception/
Ways to fix
This exception is dropped by requests UnitTests.
with pytest.raises(Exception)
Just makes sure that the inner code will raise an exception.
The code:
raise Exception('Expected exception')
Makes raise itself.
Then
assert 'Expected exception' in str(exception.value)
Checks that exception string is right
Add a possible fix
Please authorize to post fix