Skip to content

Commit

Permalink
pythongh-115285: Fix test_dataclasses with -OO mode (python#115286)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Feb 12, 2024
1 parent de7d67b commit 4297d73
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 4297d73

Please sign in to comment.