Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d732134

Browse filesBrowse 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 <mail@sobolevn.me>
1 parent c568d44 commit d732134
Copy full SHA for d732134

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎Lib/test/test_dataclasses/__init__.py

Copy file name to clipboardExpand all lines: Lib/test/test_dataclasses/__init__.py
+3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.