Skip to content

Commit c651559

Browse files
committed
fix: avoid non version locking tests
1 parent e3a77f1 commit c651559

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

kernels/tests/test_basic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44
import torch
55
import torch.nn.functional as F
6-
from huggingface_hub.errors import RepositoryNotFoundError
6+
from huggingface_hub.errors import HfHubHTTPError
77

88
from kernels import get_kernel, get_local_kernel, has_kernel, install_kernel
99

@@ -131,6 +131,7 @@ def test_has_kernel(kernel_exists):
131131
assert has_kernel(repo_id, revision=revision) == kernel
132132

133133

134+
@pytest.mark.skip(reason="Tags are not supported on kernel repos")
134135
def test_version_old():
135136
# Remove once we drop support for version specs.
136137
kernel = get_kernel("kernels-test/versions")
@@ -243,7 +244,7 @@ def test_local_overrides(monkeypatch, local_kernel_path):
243244

244245
# Ensure that we are testing with a non-existing kernel, so that we know
245246
# that the kernel must be local.
246-
with pytest.raises(RepositoryNotFoundError):
247+
with pytest.raises(HfHubHTTPError):
247248
get_kernel(f"kernels-test/{package_name}")
248249

249250
with monkeypatch.context() as m:

kernels/tests/test_kernel_locking.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def forward(self) -> str:
7575
assert version() == "1"
7676

7777

78+
@pytest.mark.skip(reason="Tags are not supported on kernel repos")
7879
def test_layer_locked_old(device):
7980
project_dir = Path(__file__).parent / "layer_locking_old"
8081

@@ -154,6 +155,7 @@ def forward(self) -> str:
154155
assert version() == "0.0.0"
155156

156157

158+
@pytest.mark.skip(reason="Tags are not supported on kernel repos")
157159
def test_func_locked_old(device):
158160
project_dir = Path(__file__).parent / "layer_locking_old"
159161

kernels/tests/test_layer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55
import torch
66
import torch.nn as nn
7-
from huggingface_hub.errors import RepositoryNotFoundError
7+
from huggingface_hub.errors import HfHubHTTPError
88
from torch.nn import functional as F
99

1010
from kernels import (
@@ -1128,6 +1128,7 @@ def test_kernel_modes_cross_fallback():
11281128
assert linear.n_calls == 2
11291129

11301130

1131+
@pytest.mark.skip(reason="Tags are not supported on kernel repos")
11311132
def test_layer_versions_old(device):
11321133
@use_kernel_forward_from_hub("Version")
11331134
class Version(nn.Module):
@@ -1319,7 +1320,7 @@ def test_local_overrides_layer(monkeypatch, local_kernel_path):
13191320
model = SiluAndMulWithKernel()
13201321

13211322
with use_kernel_mapping(mapping, inherit_mapping=False):
1322-
with pytest.raises(RepositoryNotFoundError):
1323+
with pytest.raises(HfHubHTTPError):
13231324
kernelize(model, device="cuda", mode=Mode.INFERENCE)
13241325

13251326
with monkeypatch.context() as m:

0 commit comments

Comments
 (0)