Skip to content

Commit

Permalink
Make the negative test on fill robust across Python versions (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
magnatelee authored Sep 29, 2022
1 parent 86658c4 commit dcef5d1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/integration/test_fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
#

import re

import numpy as np
import pytest

Expand Down Expand Up @@ -52,10 +54,14 @@ def test_fill_int_with_none():
a_num = num.array(a_np)
# numpy fill with -9223372036854775808,
# while cunumeric raises TypeError
msg = (
r"argument must be a string, "
r"a bytes-like object or a number, not 'NoneType'"
)
#
# Update (wonchan): Numpy 1.23.3 no longer fills
# the array with -9223372036854775808 on 'array.fill(None)'
# but raises the same exception as cuNumeric
try:
int(None)
except TypeError as e:
msg = re.escape(str(e))
with pytest.raises(TypeError, match=msg):
a_num.fill(None)

Expand Down

0 comments on commit dcef5d1

Please sign in to comment.