Skip to content

Commit

Permalink
[3.11] gh-115285: Fix test_dataclasses with -OO mode (GH-115286) (#…
Browse files Browse the repository at this point in the history
…115358)

gh-115285: Fix `test_dataclasses` with `-OO` mode (GH-115286)
(cherry picked from commit 4297d73)

Co-authored-by: Nikita Sobolev <[email protected]>
  • Loading branch information
miss-islington and sobolevn authored Feb 12, 2024
1 parent c568d44 commit d732134
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 @@ -2143,6 +2145,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 d732134

Please sign in to comment.