Skip to content

Commit 2ed47d8

Browse files
[3.12] gh-115285: Fix test_dataclasses with -OO mode (GH-115286) (#115359)
gh-115285: Fix `test_dataclasses` with `-OO` mode (GH-115286) (cherry picked from commit 4297d73) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 8774f50 commit 2ed47d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_dataclasses/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import typing # Needed for the string "typing.ClassVar[int]" to work as an annotation.
2323
import dataclasses # Needed for the string "dataclasses.InitVar[int]" to work as an annotation.
2424

25+
from test import support
26+
2527
# Just any custom exception we can catch.
2628
class CustomError(Exception): pass
2729

@@ -2216,6 +2218,7 @@ def assertDocStrEqual(self, a, b):
22162218
# whitespace stripped.
22172219
self.assertEqual(a.replace(' ', ''), b.replace(' ', ''))
22182220

2221+
@support.requires_docstrings
22192222
def test_existing_docstring_not_overridden(self):
22202223
@dataclass
22212224
class C:

0 commit comments

Comments
 (0)