Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the negative test on fill robust across Python versions #619

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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