From: Nikita Sobolev Date: Sat, 21 Oct 2023 12:09:01 +0000 (+0300) Subject: gh-111155: Fix direct invocation of test_pprint (GH-111156) X-Git-Tag: v3.13.0a2~375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e136e2d640f4686b63ea05088d481115185fc305;p=thirdparty%2FPython%2Fcpython.git gh-111155: Fix direct invocation of test_pprint (GH-111156) --- diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index 6ea7e7db2ce1..4d1766fb16ce 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -7,6 +7,7 @@ import io import itertools import pprint import random +import re import test.support import test.test_set import types @@ -535,7 +536,10 @@ AdvancedNamespace(the=0, def test_dataclass_no_repr(self): dc = dataclass3() formatted = pprint.pformat(dc, width=10) - self.assertRegex(formatted, r"") + self.assertRegex( + formatted, + fr"<{re.escape(__name__)}.dataclass3 object at \w+>", + ) def test_recursive_dataclass(self): dc = dataclass4(None)