Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
4.83k stars 2.29k forks source link

Suppress nonsense `DeprecationWarning` caused by `unittest` (backport #12676) #12687

Closed mergify[bot] closed 2 days ago

mergify[bot] commented 3 days ago

Summary

unittest.TestCase.assertWarns in context-manager form has an awkward habit of querying the __warningregistry__ attribute on every module in existence. This interacts poorly with a Numpy 2 deprecation warning trigger for code that's attempting to import functions from modules that became private in Numpy 2, if a warning has previously been triggered out of numpy.linalg._linalg.

This simply suppresses that particular warning from the test suite.

Details and comments


This is an automatic backport of pull request #12676 done by Mergify.

qiskit-bot commented 3 days ago

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

coveralls commented 3 days ago

Pull Request Test Coverage Report for Build 9714396574

Details


Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/qasm2/src/lex.rs 5 92.11%
<!-- Total: 6 -->
Totals Coverage Status
Change from base Build 9685829487: 0.02%
Covered Lines: 61853
Relevant Lines: 68757

💛 - Coveralls