From 6d0df676959785aad0bc894bf003d45907ccf3d5 Mon Sep 17 00:00:00 2001 From: aaarrti Date: Sun, 28 Apr 2024 14:13:11 +0200 Subject: [PATCH] :construction: --- tests/functions/test_pytorch_model.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/functions/test_pytorch_model.py b/tests/functions/test_pytorch_model.py index f29cf3eb..cbd24045 100644 --- a/tests/functions/test_pytorch_model.py +++ b/tests/functions/test_pytorch_model.py @@ -1,9 +1,7 @@ from collections import OrderedDict from contextlib import nullcontext -from typing import Any, Union -from types import ModuleType +from typing import Union import sys -from unittest.mock import MagicMock import numpy as np import pytest @@ -308,7 +306,7 @@ def test_huggingface_classifier_predict( def mock_transformers_not_installed(mocker: pytest_mock.MockerFixture): mock_dict = {k: v for k, v in sys.modules.items() if "transformers" not in k} mocker.patch.dict("sys.modules", mock_dict) - model = MagicMock(spec=None) + model = mocker.MagicMock(spec=None) model.training = False yield model mocker.resetall(return_value=True, side_effect=True)