diff options
-rw-r--r-- | Lib/test/test_pprint.py | 6 |
1 files changed, 5 insertions, 1 deletions
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"<test.test_pprint.dataclass3 object at \w+>") + self.assertRegex( + formatted, + fr"<{re.escape(__name__)}.dataclass3 object at \w+>", + ) def test_recursive_dataclass(self): dc = dataclass4(None) |