pytest-dev / pytest-dev/pytest

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

Open
#9,778 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

plugin: doctests type: regression
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

https://github.com/pytest-dev/pytest/blob/f0bf4c968195d2b17b002e866e2d0766184e02a4/src/_pytest/doctest.py#L477

Can someone reason why func is passed to _stop and not obj, this was changed in this commit https://github.com/pytest-dev/pytest/commit/32dd0e87cb2e6750c1fc2356eb451c9811bdb065.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/_pytest/doctest.py line 477 and compare the func argument passed to _stop with obj, using commit 32dd0e87cb2e6750c1fc2356eb451c9811bdb065 as context. Reproduce a doctest case with wrapped functions that needs inner-wrapper details, then determine whether the behavior is incorrect and verify that stop evaluation receives the required object.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.