mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-111155: Fix direct invocation of test_pprint (GH-111156)
This commit is contained in:
parent
86276fe4f8
commit
e136e2d640
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue