From e136e2d640f4686b63ea05088d481115185fc305 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 21 Oct 2023 15:09:01 +0300 Subject: gh-111155: Fix direct invocation of test_pprint (GH-111156) --- Lib/test/test_pprint.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index 6ea7e7d..4d1766f 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) -- cgit v0.12