From 970402f34fffb21bda53cea47c5a9024a371f7ac Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Fri, 29 Mar 2024 10:30:00 +0100 Subject: [PATCH] Fix for Pytest 8 --- hickle/tests/test_hickle.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hickle/tests/test_hickle.py b/hickle/tests/test_hickle.py index 2d65a307..5c6c8f39 100644 --- a/hickle/tests/test_hickle.py +++ b/hickle/tests/test_hickle.py @@ -16,6 +16,7 @@ import re from pprint import pprint import pickle +import warnings # Package imports @@ -793,9 +794,9 @@ def test_slash_dict_keys(test_file_name,compression_kwargs): # Check that having backslashes in dict keys will serialize the dict dct2 = {'a\\b': [1, '2'], 1.4: 3} - with pytest.warns(None) as not_expected: + with warnings.catch_warnings(): + warnings.simplefilter("error") dump(dct2, test_file_name,**compression_kwargs) - assert not not_expected # %% MAIN SCRIPT