Skip to content

Calling inspect.signature with an AsyncMock instance raises an exception #96127

Closed
@yvan-the-barbarian

Description

@yvan-the-barbarian

Bug report

Starting in Python 3.10.6, the following code raises an exception:

from inspect import signature
from unittest.mock import AsyncMock

mock = AsyncMock()
signature(mock)
  • No exception is raised when Mock is used.
  • The exception does not occur with Python 3.10.5.

Your environment

  • CPython versions tested on: 3.10.4, 3.10.5, 3.10.6 (Only occurs in 3.10.6)
  • Operating system and architecture: Windows 10, Linux (Official Docker Image)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions