Skip to content

Commit

Permalink
gh-111155: Fix direct invocation of test_pprint (GH-111156)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Oct 21, 2023
1 parent 86276fe commit e136e2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lib/test/test_pprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import itertools
import pprint
import random
import re
import test.support
import test.test_set
import types
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e136e2d

Please sign in to comment.