scripts: requirements: remove dependency to mock package

mock has been available in Python standard lib since Python 3.3, remove
the unnecessary dependency to `mock` pip package.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2025-07-02 13:54:36 +02:00 committed by Anas Nashif
parent f39ec79806
commit edead766dc
41 changed files with 43 additions and 46 deletions

View File

@ -6,7 +6,7 @@
Tests for check_init_priorities
"""
import mock
from unittest import mock
import pathlib
import unittest

View File

@ -653,10 +653,6 @@ mccabe==0.7.0 \
--hash=sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325 \
--hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e
# via pylint
mock==5.2.0 \
--hash=sha256:4e460e818629b4b173f32d08bf30d3af8123afbb8e04bb5707a1fd4799e503f0 \
--hash=sha256:7ba87f72ca0e915175596069dbbcc7c75af7b5e9b9bc107ad6349ede0819982f
# via -r requirements-actions.in
msgpack==1.1.1 ; sys_platform != 'win32' \
--hash=sha256:196a736f0526a03653d829d7d4c5500a97eea3648aebfd4b6743875f28aa2af8 \
--hash=sha256:1abfc6e949b352dadf4bce0eb78023212ec5ac42f6abfd469ce91d783c149c2a \

View File

@ -17,8 +17,5 @@ coverage
pytest
mypy
# used for mocking functions in pytest
mock>=4.0.1
# used for JUnit XML parsing in CTest harness
junitparser

View File

@ -6,10 +6,10 @@
Tests for domains.py classes
"""
import mock
import os
import sys
from contextlib import nullcontext
from unittest import mock
import pytest

View File

@ -6,7 +6,7 @@
Tests for cmakecache.py classes' methods
"""
import mock
from unittest import mock
import pytest
from contextlib import nullcontext

View File

@ -9,7 +9,7 @@ Tests for config_parser.py
import os
import pytest
import mock
from unittest import mock
import scl
from twisterlib.config_parser import TwisterConfigParser, extract_fields_from_arg_list, ConfigurationError

View File

@ -7,7 +7,7 @@
Tests for environment.py classes' methods
"""
import mock
from unittest import mock
import os
import pytest
import shutil

View File

@ -8,7 +8,7 @@ Tests for handlers.py classes' methods
"""
import itertools
import mock
from unittest import mock
import os
import pytest
import signal

View File

@ -6,7 +6,7 @@
Tests for hardwaremap.py classes' methods
"""
import mock
from unittest import mock
import pytest
import sys

View File

@ -6,7 +6,7 @@
"""
This test file contains testsuites for the Harness classes of twister
"""
import mock
from unittest import mock
import sys
import os
import pytest

View File

@ -7,7 +7,7 @@ Tests for jobserver.py classes' methods
"""
import functools
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Tests for log_helper.py functions
"""
import logging
import mock
from unittest import mock
import pytest
from importlib import reload

View File

@ -8,7 +8,7 @@ This test file contains tests for platform.py module of twister
'''
import sys
import os
import mock
from unittest import mock
import pytest
from contextlib import nullcontext

View File

@ -6,7 +6,7 @@
Tests for quarantine.py classes' methods
"""
import mock
from unittest import mock
import os
import pytest
import textwrap

View File

@ -7,7 +7,7 @@ Tests for runner.py classes
"""
import errno
import mock
from unittest import mock
import os
import pathlib
import pytest

View File

@ -7,7 +7,7 @@ Tests for scl.py functions
"""
import logging
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -11,7 +11,7 @@ from contextlib import nullcontext
import os
import sys
import pytest
import mock
from unittest import mock
ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))

View File

@ -8,7 +8,7 @@ This test file contains testsuites for testsuite.py module of twister
'''
import sys
import os
import mock
from unittest import mock
import pytest
from contextlib import nullcontext

View File

@ -7,7 +7,7 @@ Tests for testinstance class
"""
import mmap
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -9,7 +9,7 @@ This test file contains foundational testcases for Twister tool
import os
import sys
import mock
from unittest import mock
import pytest
from pathlib import Path

View File

@ -7,7 +7,7 @@
import logging
import shutil
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions concerning addons to normal
"""
import importlib
import mock
from unittest import mock
import os
import pkg_resources
import pytest
@ -16,6 +16,7 @@ import shutil
import subprocess
import sys
# pylint: disable=no-name-in-module
from conftest import ZEPHYR_BASE, TEST_DATA, sample_filename_mock, testsuite_filename_mock
from twisterlib.testplan import TestPlan

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions related to test configuratio
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions
"""
import importlib
import re
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions related to test filtering.
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -8,11 +8,12 @@ Blackbox tests for twister's command line functions related to disable features.
import importlib
import pytest
import mock
from unittest import mock
import os
import sys
import re
# pylint: disable=no-name-in-module
from conftest import ZEPHYR_BASE, TEST_DATA, testsuite_filename_mock
from twisterlib.testplan import TestPlan

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions - simple does-error-out or n
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions related to test filtering.
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -8,7 +8,7 @@ Blackbox tests for twister's command line functions related to memory footprints
import importlib
import json
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -6,11 +6,12 @@
Blackbox tests for twister's command line functions
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys
# pylint: disable=no-name-in-module
from conftest import ZEPHYR_BASE, testsuite_filename_mock, clear_log_in_test
from twisterlib.testplan import TestPlan

View File

@ -8,7 +8,7 @@ Blackbox tests for twister's command line functions changing the output files.
import importlib
import re
import mock
from unittest import mock
import os
import shutil
import pytest

View File

@ -8,7 +8,7 @@ Blackbox tests for twister's command line functions changing test output.
import importlib
import re
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -8,7 +8,7 @@ Blackbox tests for twister's command line functions related to Zephyr platforms.
import importlib
import re
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions related to the quarantine.
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import re

View File

@ -8,7 +8,7 @@ Blackbox tests for twister's command line functions
import importlib
import json
import mock
from unittest import mock
import os
import pytest
import shutil

View File

@ -8,7 +8,7 @@ Blackbox tests for twister's command line functions
# pylint: disable=duplicate-code
import importlib
import mock
from unittest import mock
import os
import pytest
import re

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions related to the shuffling of
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions related to saving and loadin
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -7,7 +7,7 @@ Blackbox tests for twister's command line functions - those requiring testplan.j
"""
import importlib
import mock
from unittest import mock
import os
import pytest
import sys

View File

@ -8,12 +8,13 @@ Blackbox tests for twister's command line functions related to Twister's tooling
# pylint: disable=duplicate-code
import importlib
import mock
from unittest import mock
import os
import pytest
import sys
import json
# pylint: disable=no-name-in-module
from conftest import ZEPHYR_BASE, TEST_DATA, sample_filename_mock, testsuite_filename_mock
from twisterlib.statuses import TwisterStatus
from twisterlib.testplan import TestPlan