gh-115285: Fix `test_dataclasses` with `-OO` mode (#115286)

This commit is contained in:
Nikita Sobolev 2024-02-12 21:31:07 +03:00 committed by GitHub
parent de7d67b19b
commit 4297d7301b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,8 @@ from functools import total_ordering
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
@ -2216,6 +2218,7 @@ class TestDocString(unittest.TestCase):
# whitespace stripped.
self.assertEqual(a.replace(' ', ''), b.replace(' ', ''))
@support.requires_docstrings
def test_existing_docstring_not_overridden(self):
@dataclass
class C: