From 1c9e7bf510901d4cf0f75a46aa85ff5e8f62f2fe Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 26 Feb 2026 10:54:51 +0100 Subject: [PATCH] chore: remove unused reports_deprecation_warning helper The contextmanager helper was defined but never called. Also removes the now-unused warnings, contextmanager, and copy imports. Co-Authored-By: Claude Opus 4.6 Change-Id: I9cbcd372905800951e853543ae3d878f76370c7a --- tests/test_tenacity.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/test_tenacity.py b/tests/test_tenacity.py index d518231..ab78ccc 100644 --- a/tests/test_tenacity.py +++ b/tests/test_tenacity.py @@ -21,9 +21,6 @@ import time import typing import unittest -import warnings -from contextlib import contextmanager -from copy import copy from fractions import Fraction from unittest import mock @@ -1990,18 +1987,6 @@ def num_to_str(number): check_type(with_constructor_result, str) -@contextmanager -def reports_deprecation_warning() -> typing.Generator[None, None, None]: - __tracebackhide__ = True - oldfilters = copy(warnings.filters) - warnings.simplefilter("always") - try: - with pytest.warns(DeprecationWarning): - yield - finally: - warnings.filters = oldfilters - - class TestMockingSleep: RETRY_ARGS = { "wait": tenacity.wait_fixed(0.1),