Skip to content

Implement get_code in AssertionRewritingHook so runpy can re-run modules - #14945

Closed
ump45nose wants to merge 3 commits into
pytest-dev:mainfrom
ump45nose:fix-9007-runpy-get-code
Closed

Implement get_code in AssertionRewritingHook so runpy can re-run modules#14945
ump45nose wants to merge 3 commits into
pytest-dev:mainfrom
ump45nose:fix-9007-runpy-get-code

test(assertion): 覆盖 runpy 未加载模块回退

13f612d
Select commit
Loading
Failed to load commit list.
PSF Chronographer / Changelog entry succeeded Aug 27, 2026 in 2s

Chronographer: Good to go

Great! This change has been recorded to the chronicles

You are good at keeping records! Image source: Unsplash ID=bByhWydZLW0

See https://docs.pytest.org/en/latest/contributing.html#preparing-pull-requests for details.
Please, refer to the following document for more details on how to
craft a great change note for inclusion with your pull request:
https://docs.pytest.org/en/latest/contributing.html#preparing-pull-requests

Details

The following news fragments found: [<PatchedFile: changelog/9007.bugfix.rst>]

Pattern: re.compile('changelog/(?P<issue_number>[^\\./]+)\.(?P<fragment_type>breaking|deprecation|feature|improvement|bugfix|vendor|doc|packaging|contrib|misc)(\.\d+)?(\.[^\\./]+)*\.rst$')