Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Bug report
Bug description:
fromdataclassesimportdataclassfromunittest.mockimportcreate_autospec@dataclassclassDescription:name:strmock=create_autospec(Description,instance=True)print(isinstance(mock,Description))
# 3.13.3True# 3.14.0b2False
Furthermore the resulting mock doesn't have attributes present on a dataclass instance, like__annotations__,__class__,__dataclass_fields__,__dataclass_params__.
print(dir(mock))print(dir(Description("Hello World"))
Likely related to#124429. /CC@sobolevn
CPython versions tested on:
3.14
Operating systems tested on:
macOS