From 74179202ed8bb65364d05801278aa5c7469afd04 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Sat, 19 Feb 2022 19:37:50 +0000 Subject: [PATCH] bpo-46801: suppress deprecation warnings in test_typing --- Lib/test/test_typing.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index b38e27c5f90471..3539e5e0266f4e 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -4586,7 +4586,9 @@ def test_typeddict_create_errors(self): with self.assertRaises(TypeError): TypedDict(_typename='Emp', name=str, id=int) with self.assertRaises(TypeError): - TypedDict('Emp', _fields={'name': str, 'id': int}) + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + TypedDict('Emp', _fields={'name': str, 'id': int}) def test_typeddict_errors(self): Emp = TypedDict('Emp', {'name': str, 'id': int}) @@ -4599,7 +4601,9 @@ def test_typeddict_errors(self): with self.assertRaises(TypeError): issubclass(dict, Emp) with self.assertRaises(TypeError): - TypedDict('Hi', x=1) + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + TypedDict('Hi', x=1) with self.assertRaises(TypeError): TypedDict('Hi', [('x', int), ('y', 1)]) with self.assertRaises(TypeError):