summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-02-12 20:27:48 (GMT)
committerGitHub <noreply@github.com>2024-02-12 20:27:48 (GMT)
commit2ed47d8f8ba3dd8e2f992a333c4382d26ec2bf20 (patch)
tree66ec22d54e1d784844b13416ac91d946c092119d
parent8774f50e29e998746e2ccf1f708d95f45ea5a818 (diff)
downloadcpython-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__.py3
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: