From f988bc41d8889e83cccab31ca445387b63793991 Mon Sep 17 00:00:00 2001 From: Oliver Bestwalter Date: Thu, 20 Jun 2024 15:23:50 +0200 Subject: [PATCH] STRING_TYPES is not necessary anymore --- src/_pytest/python_api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 8f3747811..d6c66def2 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -376,9 +376,7 @@ class ApproxSequenceLike(ApproxBase): def _check_type(self) -> None: __tracebackhide__ = True for index, x in enumerate(self.expected): - if (isinstance(x, Collection) or isinstance(x, Mapping)) and not isinstance( - x, STRING_TYPES - ): + if (isinstance(x, Collection) or isinstance(x, Mapping)) and not isinstance(x, str): msg = "pytest.approx() does not support nested data structures: {!r} at index {}\n full sequence: {}" raise TypeError(msg.format(x, index, pprint.pformat(self.expected)))