Skip to content

Commit d732134

Browse files
[3.11] gh-115285: Fix test_dataclasses with -OO mode (GH-115286) (#115358)
gh-115285: Fix `test_dataclasses` with `-OO` mode (GH-115286) (cherry picked from commit 4297d73) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent c568d44 commit d732134

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

@@ -2143,6 +2145,7 @@ def assertDocStrEqual(self, a, b):
21432145
# whitespace stripped.
21442146
self.assertEqual(a.replace(' ', ''), b.replace(' ', ''))
21452147

2148+
@support.requires_docstrings
21462149
def test_existing_docstring_not_overridden(self):
21472150
@dataclass
21482151
class C:

0 commit comments

Comments
 (0)