diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d66bcb01ac..a723effe40 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -332,7 +332,6 @@ repos: - portend - pylint-pytest ~= 2.0.0a0 - pyOpenSSL # needed by pylint-pytest since it picks up pytest's args - - pypytools - pytest-cov # needed by pylint-pytest since it picks up pytest's args - pytest-mock # needed by pylint-pytest since it picks up pytest's args - >- # needed by pylint-pytest since it picks up pytest's args diff --git a/cheroot/test/test_server.py b/cheroot/test/test_server.py index ae6e390a44..11c47231fa 100644 --- a/cheroot/test/test_server.py +++ b/cheroot/test/test_server.py @@ -1,5 +1,6 @@ """Tests for the HTTP server.""" +import gc import os import pathlib import queue @@ -17,7 +18,6 @@ import requests import requests_unixsocket -from pypytools.gc.custom import DefaultGc from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS, SYS_PLATFORM, bton, ntob from ..server import IS_UID_GID_RESOLVABLE, Gateway, HTTPServer @@ -418,8 +418,9 @@ def test_reuse_port(http_server, ip_addr, mocker): @pytest.fixture def _garbage_bin(): """Disable garbage collection when this fixture is in use.""" - with DefaultGc().nogc(): - yield + gc.disable() + yield + gc.enable() @pytest.fixture diff --git a/dependencies/direct/py.in b/dependencies/direct/py.in index 486e8fcadd..6a5ec097d6 100644 --- a/dependencies/direct/py.in +++ b/dependencies/direct/py.in @@ -23,11 +23,6 @@ portend pyopenssl -# The pypytools library provides a cross-implementation context -# manager for disabling garbage collection in specific blocks -# of the control flow: -pypytools - pytest-clarity pytest-cov pytest-mock >= 1.11.0 diff --git a/docs/changelog-fragments.d/880.contrib.rst b/docs/changelog-fragments.d/880.contrib.rst new file mode 100644 index 0000000000..97766ab44d --- /dev/null +++ b/docs/changelog-fragments.d/880.contrib.rst @@ -0,0 +1,9 @@ +Made the test of high file descriptor numbers disable garbage +collection while it runs, as its fixture intended: the +:pypi:`pypytools` context manager that it used only pauses the +collections that :pypi:`pypytools` starts itself, so the interpreter's +collector kept running and could free a low file descriptor for the +server to take. Nothing else used :pypi:`pypytools`, so it is no +longer a test dependency. + +-- by :user:`rm-you`