Closed jwodder closed 7 months ago
I think this might be related to #685
I will investigate later
This issue most likely also is the cause of the test suite failing on pypy3 (we tested it for packaging responses-0.24.0 for Gentoo). It fails with resource exhaustion of open files.
We don't need – actually don't want – any kind of networking during our test battery execution. The following fixture is a workaround.
import pytest
import unittest
@pytest.fixture(autouse=True)
def disable_builtin_socket(scope='session'):
with unittest.mock.patch('socket.socket'):
yield
Describe the bug
Consider the following pytest test file:
This is accompanied by the following pytest configuration in
tox.ini
:Running
pytest
on the above test succeeds without a problem with responses 0.23.3, but if responses 0.24.0 is used, the test fails with:I suspect that the newer
responses
isn't closing a socket somewhere, possibly due to failure to use a context manager.Additional context
No response
Version of
responses
0.24.0
Steps to Reproduce
I just filled that out above.
Expected Result
No errors.
Actual Result
See errors above.