From 945e90e85347f9f91da17d85a8fe40f5bd399641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20August=C3=BDn?= Date: Mon, 10 Nov 2025 11:58:07 +0100 Subject: [PATCH] chore(deps): pytest 9.x allowed --- setup.cfg | 5 +++-- src/pytest_docker/plugin.py | 3 ++- tests/test_dockercomposeexecutor.py | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index 38af61d..02c4383 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pytest-docker -version = 3.2.3 +version = 3.2.4 description = Simple pytest fixtures for Docker and Docker Compose based tests long_description = file: README.md long_description_content_type = text/markdown @@ -35,7 +35,7 @@ package_dir= packages=pytest_docker install_requires = - pytest >=4.0, <9.0 + pytest >=4.0, <10.0 attrs >=19.2.0 [options.extras_require] @@ -85,3 +85,4 @@ strict = true mypy_path = "src/pytest_docker,tests" namespace_packages = true warn_unused_ignores = true +warn_return_any = false diff --git a/src/pytest_docker/plugin.py b/src/pytest_docker/plugin.py index 2b2c53a..3a2443e 100644 --- a/src/pytest_docker/plugin.py +++ b/src/pytest_docker/plugin.py @@ -1,5 +1,6 @@ import contextlib import os +from pathlib import Path import re import subprocess import time @@ -119,7 +120,7 @@ def wait_until_responsive( raise Exception("Timeout reached while waiting on service!") -def str_to_list(arg: Union[str, List[Any], Tuple[Any]]) -> Union[List[Any], Tuple[Any]]: +def str_to_list(arg: Union[str, Path, List[Any], Tuple[Any]]) -> Union[List[Any], Tuple[Any]]: if isinstance(arg, (list, tuple)): return arg return [arg] diff --git a/tests/test_dockercomposeexecutor.py b/tests/test_dockercomposeexecutor.py index 04b8094..6741c4f 100644 --- a/tests/test_dockercomposeexecutor.py +++ b/tests/test_dockercomposeexecutor.py @@ -1,7 +1,7 @@ import subprocess from unittest import mock -import py +from pathlib import Path from pytest_docker.plugin import DockerComposeExecutor @@ -31,9 +31,9 @@ def test_execute_docker_compose_v2() -> None: ] -def test_pypath_compose_files() -> None: - compose_file: py.path.local = py.path.local("/tmp/docker-compose.yml") - docker_compose = DockerComposeExecutor("docker compose", compose_file, "pytest123") # type: ignore +def test_path_compose_file() -> None: + compose_file: Path = Path("/tmp/docker-compose.yml") + docker_compose = DockerComposeExecutor("docker compose", compose_file, "pytest123") with mock.patch("subprocess.check_output") as check_output: docker_compose.execute("up") assert check_output.call_args_list == [