From e4bca36f45f9fc9ebb445d783a8a62c00ad7a6f1 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 20 Nov 2023 16:24:55 +0000 Subject: [PATCH] Add missing contextmanager to decorator --- setuptools/tests/test_logging.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setuptools/tests/test_logging.py b/setuptools/tests/test_logging.py index eab30b9d14..beff309362 100644 --- a/setuptools/tests/test_logging.py +++ b/setuptools/tests/test_logging.py @@ -1,6 +1,7 @@ import inspect import logging import sys +from contextlib import contextmanager import pytest @@ -41,7 +42,8 @@ def test_verbosity_level(tmp_path, monkeypatch, flag, expected_level): assert log_level_name == expected_level -def _flaky_on_pypy(func): +@contextmanager +def flaky_on_pypy(func): try: func() except AssertionError: # pragma: no cover @@ -51,7 +53,7 @@ def _flaky_on_pypy(func): raise -@_flaky_on_pypy +@flaky_on_pypy def test_patching_does_not_cause_problems(): # Ensure `dist.log` is only patched if necessary