Skip to content

Commit 9e1538e

Browse files
pavoljuhasBichengYing
authored andcommitted
Drop temporary warnings about changed data promotion in numpy-2 (quantumlib#7258)
numpy had a warnings helper for that which got removed in numpy-2.2. Also remove the custom pytest option `--warn-numpy-data-promotion`. Fixes numpy-2 test failure due to use of removed function.
1 parent 459d72f commit 9e1538e

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ jobs:
230230
pip install wheel
231231
pip install --upgrade --upgrade-strategy eager -r dev_tools/requirements/dev-np2.env.txt
232232
- name: Pytest check
233-
run: check/pytest -n auto --warn-numpy-data-promotion --durations=20 --ignore=cirq-rigetti
233+
run: check/pytest -n auto --durations=20 --ignore=cirq-rigetti
234234
pip-compile:
235235
name: Check consistency of requirements
236236
runs-on: ubuntu-22.04

conftest.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import numpy as np
1615
import pytest
1716

1817

@@ -26,19 +25,6 @@ def pytest_addoption(parser):
2625
parser.addoption(
2726
"--enable-slow-tests", action="store_true", default=False, help="run slow tests"
2827
)
29-
parser.addoption(
30-
"--warn-numpy-data-promotion",
31-
action="store_true",
32-
default=False,
33-
help="enable NumPy 2 data type promotion warnings",
34-
)
35-
36-
37-
def pytest_configure(config):
38-
# If requested, globally enable verbose NumPy 2 warnings about data type
39-
# promotion. See https://numpy.org/doc/2.0/numpy_2_0_migration_guide.html.
40-
if config.option.warn_numpy_data_promotion:
41-
np._set_promotion_state("weak_and_warn")
4228

4329

4430
def pytest_collection_modifyitems(config, items):

0 commit comments

Comments
 (0)