Skip to content

Commit

Permalink
Update template_test_nncf_tensor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev authored Dec 16, 2024
1 parent 9e24000 commit a5871bf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/cross_fw/test_templates/template_test_nncf_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


import operator
import os
from abc import abstractmethod
from math import log2
from math import sqrt
Expand Down Expand Up @@ -1711,14 +1710,13 @@ def test_save_load_file(self, tmp_path, data):
assert loaded_stat[tensor_key].device == tensor.device
assert loaded_stat[tensor_key].dtype == tensor.dtype

@pytest.mark.parametrize("data", [[[3.0, 2.0, 2.0], [2.0, 3.0, -2.0]]])
def test_save_load_symlink(self, tmp_path, data):
def test_save_load_symlink_error(self, tmp_path):
file_path = tmp_path / "test_tensor"
symlink_path = tmp_path / "symlink_test_tensor"
os.symlink(file_path, symlink_path)
file_path.symlink_to(symlink_path)

tensor_key = "tensor_key"
tensor = Tensor(self.to_tensor(data))
tensor = Tensor(self.to_tensor([1, 2]))
stat = {tensor_key: tensor}

with pytest.raises(nncf.ValidationError, match="symbolic link"):
Expand Down

0 comments on commit a5871bf

Please sign in to comment.