summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dataclasses.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-04-23 15:40:52 (GMT)
committerGitHub <noreply@github.com>2023-04-23 15:40:52 (GMT)
commitec29d0c0916af129eaafb0ad392449ca173309ed (patch)
tree72456ff062f4499f73d1ecf25c428c7f0b3e3429 /Lib/test/test_dataclasses.py
parent6e25228b2e8bd9556b879c629ee20876271bf7da (diff)
downloadcpython-ec29d0c0916af129eaafb0ad392449ca173309ed.zip
cpython-ec29d0c0916af129eaafb0ad392449ca173309ed.tar.gz
cpython-ec29d0c0916af129eaafb0ad392449ca173309ed.tar.bz2
[3.11] gh-103449: Fix a bug in dataclass docstring generation (GH-103454) (#103599)
Diffstat (limited to 'Lib/test/test_dataclasses.py')
-rw-r--r--Lib/test/test_dataclasses.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index abe02e3..1aaa78d 100644
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -2224,6 +2224,19 @@ class TestDocString(unittest.TestCase):
self.assertDocStrEqual(C.__doc__, "C(x:collections.deque=<factory>)")
+ def test_docstring_with_no_signature(self):
+ # See https://github.com/python/cpython/issues/103449
+ class Meta(type):
+ __call__ = dict
+ class Base(metaclass=Meta):
+ pass
+
+ @dataclass
+ class C(Base):
+ pass
+
+ self.assertDocStrEqual(C.__doc__, "C")
+
class TestInit(unittest.TestCase):
def test_base_has_init(self):