diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2024-02-12 18:31:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 18:31:07 (GMT) |
commit | 4297d7301b97aba2e0df9f9cc5fa4010e53a8950 (patch) | |
tree | d6d28d000e015c605488575c5152316dd63ef25e /Lib/test | |
parent | de7d67b19b9f31d7712de7211ffac5bf6018157f (diff) | |
download | cpython-4297d7301b97aba2e0df9f9cc5fa4010e53a8950.zip cpython-4297d7301b97aba2e0df9f9cc5fa4010e53a8950.tar.gz cpython-4297d7301b97aba2e0df9f9cc5fa4010e53a8950.tar.bz2 |
gh-115285: Fix `test_dataclasses` with `-OO` mode (#115286)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_dataclasses/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_dataclasses/__init__.py b/Lib/test/test_dataclasses/__init__.py index 272d427..ede74b0 100644 --- a/Lib/test/test_dataclasses/__init__.py +++ b/Lib/test/test_dataclasses/__init__.py @@ -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: |