8000 gh-111155: Fix direct invocation of test_pprint (GH-111156) · python/cpython@e136e2d · GitHub
[go: up one dir, main page]

Skip to content

Commit e136e2d

Browse files
authored
gh-111155: Fix direct invocation of test_pprint (GH-111156)
1 parent 86276fe commit e136e2d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_pprint.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import itertools
88
import pprint
99
import random
10+
import re
1011
import test.support
1112
import test.test_set
1213
import types
@@ -535,7 +536,10 @@ def test_dataclass_with_repr(self):
535536
def test_dataclass_no_repr(self):
536537
dc = dataclass3()
537538
formatted = pprint.pformat(dc, width=10)
538-
self.assertRegex(formatted, r"<test.test_pprint.dataclass3 object at \w+>")
539+
self.assertRegex(
540+
formatted,
541+
fr"<{re.escape(__name__)}.dataclass3 object at \w+>",
542+
)
539543

540544
def test_recursive_dataclass(self):
541545
dc = dataclass4(None)

0 commit comments

Comments
 (0)
0