From 9ed9aac7ac205cf1bd5bf07d31434f01b176649b Mon Sep 17 00:00:00 2001 From: Marek Mihok Date: Wed, 13 Mar 2024 14:06:19 +0100 Subject: [PATCH] ci: Resolve resource warning in py tests #2261 (#2286) --- py/Makefile | 2 +- py/tests/__main__.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/py/Makefile b/py/Makefile index 4e087677cd..9c7b036af8 100644 --- a/py/Makefile +++ b/py/Makefile @@ -38,7 +38,7 @@ setup-tests: ## Install dependencies for tests only python3 -m venv venv echo "# Generated in hatch_build.py\n__platform__ = 'linux'\n__arch__ = 'amd64'" > h2o_wave/h2o_wave/metadata.py ./venv/bin/python -m pip install --editable h2o_wave - ./venv/bin/pip install httpx typing_extensions + ./venv/bin/pip install httpx urllib3 typing_extensions .PHONY: docs docs: ## Build API docs diff --git a/py/tests/__main__.py b/py/tests/__main__.py index a87194df45..0337067af0 100644 --- a/py/tests/__main__.py +++ b/py/tests/__main__.py @@ -6,6 +6,9 @@ import os import platform +# HACK: Use urllib3 import side-effect to resolve "ResourceWarning: unclosed transport" in python>=3.9 versions. +import urllib3 + from .test_expando import * from .test_python_server import * from .test_python_server_async import *