Skip to content

Commit

Permalink
pythongh-115285: Fix test_dataclasses with -OO mode (pythonGH-115286
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 4297d73)

Co-authored-by: Nikita Sobolev <[email protected]>
  • Loading branch information
sobolevn authored and miss-islington committed Feb 12, 2024
1 parent 225856e commit 1597d7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_dataclasses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import typing # Needed for the string "typing.ClassVar[int]" to work as an annotation.
import dataclasses # Needed for the string "dataclasses.InitVar[int]" to work as an annotation.

from test import support

# Just any custom exception we can catch.
class CustomError(Exception): pass

Expand Down Expand Up @@ -2216,6 +2218,7 @@ def assertDocStrEqual(self, a, b):
# whitespace stripped.
self.assertEqual(a.replace(' ', ''), b.replace(' ', ''))

@support.requires_docstrings
def test_existing_docstring_not_overridden(self):
@dataclass
class C:
Expand Down

0 comments on commit 1597d7b

Please sign in to comment.