From 1eee49001d33f9c5c09cc2205a75f45e39ec963c Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Wed, 19 Jun 2024 16:17:21 +0200 Subject: [PATCH] TEST update test to pass with numpy 2 --- dev-requirements.txt | 2 +- tests/cloudpickle_test.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 933e6909..35c529fe 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -9,7 +9,7 @@ psutil tornado # To be able to test numpy specific things # but do not build numpy from source on Python nightly -numpy >=1.18.5; python_version <= '3.8' +numpy >=1.18.5; python_version <= '3.12' # Code coverage uploader for Travis: codecov coverage diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py index 5aa4baca..ac4bcec1 100644 --- a/tests/cloudpickle_test.py +++ b/tests/cloudpickle_test.py @@ -1501,7 +1501,10 @@ def test_importing_multiprocessing_does_not_impact_whichmodule(self): ) out, _ = proc.communicate() self.assertEqual(proc.wait(), 0) - self.assertEqual(out, b"numpy.core._multiarray_umath\n") + assert out.strip() in ( + b"numpy.core._multiarray_umath", # numpy 1 + b"numpy._core._multiarray_umath", # numpy 2 + ) def test_unrelated_faulty_module(self): # Check that pickling a dynamically defined function or class does not