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.82k stars 2.29k forks source link

Suppress nonsense `DeprecationWarning` caused by `unittest` #12676

Closed jakelishman closed 3 days ago

jakelishman 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

qiskit-bot commented 3 days ago

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

coveralls commented 3 days ago

Pull Request Test Coverage Report for Build 9705924154

Details


Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 92.62%
crates/qasm2/src/parse.rs 6 97.15%
<!-- Total: 11 -->
Totals Coverage Status
Change from base Build 9703107599: 0.01%
Covered Lines: 63805
Relevant Lines: 71092

💛 - Coveralls
coveralls commented 3 days ago

Pull Request Test Coverage Report for Build 9710892224

Details


Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 93.89%
<!-- Total: 4 -->
Totals Coverage Status
Change from base Build 9703107599: 0.03%
Covered Lines: 63822
Relevant Lines: 71092

💛 - Coveralls
coveralls commented 3 days ago

Pull Request Test Coverage Report for Build 9712800437

Details


Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 93.13%
<!-- Total: 3 -->
Totals Coverage Status
Change from base Build 9703107599: 0.03%
Covered Lines: 63819
Relevant Lines: 71092

💛 - Coveralls