1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Date: Tue, 13 Dec 2022 16:53:53 +0100
Subject: Remove dependency on pypytools
Pypytools is not packaged in Debian/Ubuntu.
Forwarded: not-needed
---
cheroot/test/test_server.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/cheroot/test/test_server.py b/cheroot/test/test_server.py
index 5e0a683..430ad12 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 queue
import socket
@@ -12,8 +13,6 @@ import pytest
import requests
import requests_unixsocket
-from pypytools.gc.custom import DefaultGc
-
from .._compat import bton, ntob
from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS, SYS_PLATFORM
from ..server import IS_UID_GID_RESOLVABLE, Gateway, HTTPServer
@@ -378,11 +377,17 @@ if not IS_WINDOWS and not ISSUE511:
test_high_number_of_file_descriptors,
)
+class GcWrapper:
+ def __enter__(self):
+ gc.disable()
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ gc.enable()
@pytest.fixture
def _garbage_bin():
"""Disable garbage collection when this fixture is in use."""
- with DefaultGc().nogc():
+ with GcWrapper():
yield
|