gh-111155: Fix direct invocation of test_pprint (GH-111156)

This commit is contained in:
Nikita Sobolev 2023-10-21 15:09:01 +03:00 committed by GitHub
parent 86276fe4f8
commit e136e2d640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,7 @@
import itertools
import pprint
import random
import re
import test.support
import test.test_set
import types
@ -535,7 +536,10 @@ def test_dataclass_with_repr(self):
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)