Skip to content

Commit 8dcee01

Browse files
authored
Ensure test_npsupport passes with numpy>=2.0.0 by explicitly setting dtype=numpy.int32. (#859)
* Ensure explicit `dtype` in `test_npsupport.py` for clarity and consistency. * Update `numpy` installation in `autotest` workflow. - Remove version constraint for numpy installation in `.github/workflows/autotest.yml`. This allows using the latest numpy version in CI tests.
1 parent 2084e47 commit 8dcee01

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/autotest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: unittest comtypes
3131
run: |
3232
if ("${{ matrix.support }}" -eq "with 3rd parties") {
33-
pip install 'numpy<2'
33+
pip install numpy
3434
pip install pywin32
3535
}
3636
pip install coverage[toml]

comtypes/test/test_npsupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_VT_BSTR_ndarray(self):
182182
def test_VT_I4_ndarray(self):
183183
t = _midlSAFEARRAY(c_long)
184184

185-
in_arr = numpy.array([11, 22, 33])
185+
in_arr = numpy.array([11, 22, 33], dtype=numpy.int32)
186186
sa = t.from_param(in_arr)
187187

188188
arr = get_ndarray(sa)

0 commit comments

Comments
 (0)