mirror of
https://github.com/python/cpython
synced 2024-09-16 03:59:56 +00:00
gh-111155: Fix direct invocation of test_pprint (GH-111156)
This commit is contained in:
parent
86276fe4f8
commit
e136e2d640
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue