Skip to content

[Doctest] Doctest inspect unwrap passing func to _stop instead of obj #9778

Not planned

Description

@akhilramkee

return real_unwrap(func, stop=lambda obj: _is_mocked(obj) or _stop(func))

Can someone reason why func is passed to _stop and not obj, this was changed in this commit 32dd0e8.

This seems to be breaking cases where stop requires details of inner wrappers of the function, as only the intial function is used for stop evaluation

Activity

  1. added
    plugin: doctests
    type: regression
    on Mar 20, 2022
  2. Zac-HD commented on Mar 20, 2022

    @Zac-HD
    Member

    Ooh, that looks like a tricky scoping issue... not sure we ever intended to support the use-case you're relying on, but it's bad that we broke it.

    Can you provide a minimal example of a test that worked before this change but not afterwards, so we can check that any proposed fix really works?

  3. RonnyPfannschmidt commented on Mar 22, 2022

    @RonnyPfannschmidt
    Member

    it does look like a unintentional change howerver

  4. RonnyPfannschmidt commented on Nov 28, 2026

    @RonnyPfannschmidt
    Member

    🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.

    Closing as no longer applicable, see #15475 (comment): the affected helper has had no caller on supported Pythons since 9.0, and #15420 removes it.


    Generated by Claude Code

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

    plugin: docteststype: regression

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions