From f55c65c4cbcbf2b6df3a4285c37854405a37747f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 7 Mar 2024 19:47:39 -0300 Subject: [PATCH] Fix compatibility with pytest 8.1 Fix #125 --- CHANGELOG.rst | 7 +++++++ src/pytest_subtests/plugin.py | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b4670e9..61508c4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,13 @@ CHANGELOG ========= +0.12.1 (2024-03-07) +------------------- + +* Fixed compatibility with upcoming pytest ``8.1.x``. (`#125`_). + +.. _#125: https://github.com/pytest-dev/pytest-subtests/issues/125 + 0.12.0 (2024-03-06) ------------------- diff --git a/src/pytest_subtests/plugin.py b/src/pytest_subtests/plugin.py index e453b2f..a498456 100644 --- a/src/pytest_subtests/plugin.py +++ b/src/pytest_subtests/plugin.py @@ -13,12 +13,12 @@ from unittest import TestCase import attr +import pluggy import pytest from _pytest._code import ExceptionInfo from _pytest.capture import CaptureFixture from _pytest.capture import FDCapture from _pytest.capture import SysCapture -from _pytest.config.compat import PathAwareHookProxy from _pytest.fixtures import SubRequest from _pytest.logging import catching_logs from _pytest.logging import LogCaptureHandler @@ -28,6 +28,7 @@ from _pytest.runner import check_interactive_exception from _pytest.unittest import TestCaseFunction + if TYPE_CHECKING: from types import TracebackType @@ -165,7 +166,7 @@ def subtests(request: SubRequest) -> Generator[SubTests, None, None]: @attr.s class SubTests: - ihook: PathAwareHookProxy = attr.ib() + ihook: pluggy.HookRelay = attr.ib() suspend_capture_ctx: Callable[[], ContextManager] = attr.ib() request: SubRequest = attr.ib()