Skip to content

Commit 85428c3

Browse files
committed
dev(hansbug): fix that
1 parent caeb494 commit 85428c3

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ jobs:
111111
torch-version: '2.0.1'
112112
- os: 'macos-latest'
113113
numpy-version: '1.18.0'
114+
- os: 'windows-latest'
115+
python-version: '3.9'
116+
numpy-version: '2.0.2'
117+
torch-version: '2.4.0'
114118

115119
steps:
116120
- name: Get system version for Linux

test/numpy/test_array.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import pytest
55
import torch
6-
from hbutils.testing import OS, vpython
6+
from hbutils.testing import OS, vpython, vpip
77

88
import treetensor.numpy as tnp
99
import treetensor.torch as ttorch
@@ -55,12 +55,18 @@ def test_size(self):
5555
assert self._DEMO_2.size == 15
5656
assert self._DEMO_3.size == 15
5757

58-
@unittest.skipUnless(OS.windows, 'Windows only')
58+
@unittest.skipUnless(OS.windows and vpip('numpy') < '2.0', 'Windows only')
5959
def test_nbytes_on_windows(self):
6060
assert self._DEMO_1.nbytes == 72
6161
assert self._DEMO_2.nbytes == 72
6262
assert self._DEMO_3.nbytes == 72
6363

64+
@unittest.skipUnless(OS.windows and vpip('numpy') >= '2', 'Windows only')
65+
def test_nbytes_on_windows_numpy2(self):
66+
assert self._DEMO_1.nbytes == 120
67+
assert self._DEMO_2.nbytes == 120
68+
assert self._DEMO_3.nbytes == 120
69+
6470
@unittest.skipUnless(OS.linux or OS.macos, 'Linux or macos only')
6571
def test_nbytes_on_linux_or_macos(self):
6672
assert self._DEMO_1.nbytes == 120

0 commit comments

Comments
 (0)