From 1d985d2eb8f9f356780637c4131a43fee9ebaea0 Mon Sep 17 00:00:00 2001 From: "Brandon T. Willard" Date: Wed, 28 Aug 2024 15:13:57 -0500 Subject: [PATCH] Fix pytest deprecation --- tests/test_config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index aac61936fa..f4941c8c57 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -2,6 +2,7 @@ import configparser as stdlib_configparser import io import pickle +import warnings import pytest @@ -20,7 +21,8 @@ def _create_test_config(): def test_api_deprecation_warning(): # accessing through configdefaults.config is the new best practice - with pytest.warns(None): + with warnings.catch_warnings(): + warnings.simplefilter("error") root = configdefaults.config assert isinstance(str(root), str)