diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-02-12 20:27:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 20:27:48 (GMT) |
commit | 2ed47d8f8ba3dd8e2f992a333c4382d26ec2bf20 (patch) | |
tree | 66ec22d54e1d784844b13416ac91d946c092119d | |
parent | 8774f50e29e998746e2ccf1f708d95f45ea5a818 (diff) | |
download | cpython-2ed47d8f8ba3dd8e2f992a333c4382d26ec2bf20.zip cpython-2ed47d8f8ba3dd8e2f992a333c4382d26ec2bf20.tar.gz cpython-2ed47d8f8ba3dd8e2f992a333c4382d26ec2bf20.tar.bz2 |
[3.12] gh-115285: Fix `test_dataclasses` with `-OO` mode (GH-115286) (#115359)
gh-115285: Fix `test_dataclasses` with `-OO` mode (GH-115286)
(cherry picked from commit 4297d7301b97aba2e0df9f9cc5fa4010e53a8950)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
-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 2b09db0..639631c 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: |