GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `unitest.mock.create_autospec(async_def)` does not create functions valid for `inspect.iscoroutinefunction` · Issue #94924 · python/cpython

unitest.mock.create_autospec(async_def) does not create functions valid for inspect.iscoroutinefunction #94924

New issue
Copy link
New issue
Copy link
Closed
Closed
unitest.mock.create_autospec(async_def) does not create functions valid for inspect.iscoroutinefunction#94924
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@graingert
graingert
opened on Jul 17, 2022
Issue body actions

discovered while creating #94923

Bug report

import unittest.mock
import inspect
import asyncio
import sys

def main():
    async def demo():
        pass
    print(f"{inspect.iscoroutinefunction(unittest.mock.create_autospec(demo))=}")
    print(f"{asyncio.iscoroutinefunction(unittest.mock.create_autospec(demo))=}")


# this prints:
# inspect.iscoroutinefunction(unittest.mock.create_autospec(demo))=False
# asyncio.iscoroutinefunction(unittest.mock.create_autospec(demo))=True

if __name__ == "__main__":
    sys.exit(main())

see also #84753

Linked PRs

  • gh-94924: support inspect.iscoroutinefunction in create_autospec(async_def) #94962

Activity

  1. graingert
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jul 17, 2022
  2. graingert commented on Jul 17, 2022

    @graingert
    graingert
    on Jul 17, 2022
    ContributorAuthor
    More actions

    this will need backporting to 3.10 and 3.11 just like #84753

  3. serhiy-storchaka
    added this to Unittest & doctest issueson Aug 20, 2022
  4. serhiy-storchaka
    moved this to Todo in Unittest & doctest issueson Aug 20, 2022
  5. cjw296
    added a commit that references this issue on Jun 9, 2023

    gh-94924: support `inspect.iscoroutinefunction` in `create_autospec(a…

    9bf8d82
  6. iritkatriel
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Nov 23, 2023
  7. serhiy-storchaka
    added this to Inspect issues 🔍on Mar 5, 2024
  8. cjw296
    closed this as completedon Mar 18, 2024
  9. github-project-automation
    moved this from Todo to Done in Unittest & doctest issueson Mar 18, 2024
  10. github-project-automation
    moved this to Done in Inspect issues 🔍on Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Unittest & doctest issues
      Status
      Done
      Show more project fields
    • Inspect issues 🔍
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.