mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
[3.11] gh-103449: Fix a bug in dataclass docstring generation (GH-103454) (#103599)
This commit is contained in:
parent
6e25228b2e
commit
ec29d0c091
3 changed files with 21 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue