Skip to content

Import numpy conditionally in pytest.approx #13563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

tybug
Copy link
Contributor

@tybug tybug commented Jun 24, 2025

Introduced in #13338.

This matches existing conditional-import behavior in pytest.approx, and improves runtime for users of pytest.approx and not numpy.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jun 24, 2025
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tybug!

@nicoddemus nicoddemus added the backport 8.4.x apply to PRs at any point; backports the changes to the 8.4.x branch label Jun 25, 2025
@nicoddemus nicoddemus merged commit ecc55b4 into pytest-dev:main Jun 25, 2025
36 checks passed
Copy link

patchback bot commented Jun 25, 2025

Backport to 8.4.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/8.4.x/ecc55b435ffd8be19146c75b215886d38421beed/pr-13563

Backported as #13566

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jun 25, 2025
This matches existing conditional-import behavior in `pytest.approx`, and improves runtime for users of `pytest.approx` and not `numpy`.

(cherry picked from commit ecc55b4)
nicoddemus pushed a commit that referenced this pull request Jun 25, 2025
This matches existing conditional-import behavior in `pytest.approx`, and improves runtime for users of `pytest.approx` and not `numpy`.

(cherry picked from commit ecc55b4)

Co-authored-by: Liam DeVoe <orionldevoe@gmail.com>
@tybug tybug deleted the numpy-conditional-import branch June 25, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 8.4.x apply to PRs at any point; backports the changes to the 8.4.x branch bot:chronographer:provided (automation) changelog entry is part of PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants