Skip to content

Commit

Permalink
dev(hansbug): fix that
Browse files Browse the repository at this point in the history
  • Loading branch information
HansBug committed Oct 20, 2024
1 parent caeb494 commit 85428c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ jobs:
torch-version: '2.0.1'
- os: 'macos-latest'
numpy-version: '1.18.0'
- os: 'windows-latest'
python-version: '3.9'
numpy-version: '2.0.2'
torch-version: '2.4.0'

steps:
- name: Get system version for Linux
Expand Down
10 changes: 8 additions & 2 deletions test/numpy/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pytest
import torch
from hbutils.testing import OS, vpython
from hbutils.testing import OS, vpython, vpip

import treetensor.numpy as tnp
import treetensor.torch as ttorch
Expand Down Expand Up @@ -55,12 +55,18 @@ def test_size(self):
assert self._DEMO_2.size == 15
assert self._DEMO_3.size == 15

@unittest.skipUnless(OS.windows, 'Windows only')
@unittest.skipUnless(OS.windows and vpip('numpy') < '2.0', 'Windows only')
def test_nbytes_on_windows(self):
assert self._DEMO_1.nbytes == 72
assert self._DEMO_2.nbytes == 72
assert self._DEMO_3.nbytes == 72

@unittest.skipUnless(OS.windows and vpip('numpy') >= '2', 'Windows only')
def test_nbytes_on_windows_numpy2(self):
assert self._DEMO_1.nbytes == 120
assert self._DEMO_2.nbytes == 120
assert self._DEMO_3.nbytes == 120

@unittest.skipUnless(OS.linux or OS.macos, 'Linux or macos only')
def test_nbytes_on_linux_or_macos(self):
assert self._DEMO_1.nbytes == 120
Expand Down

0 comments on commit 85428c3

Please sign in to comment.