STRING_TYPES is not necessary anymore

This commit is contained in:
Oliver Bestwalter 2024-06-20 15:23:50 +02:00 committed by GitHub
parent 6a9dc37cf1
commit f988bc41d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -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)))