Directly import mock from unittest

It is not a separate package since Python 3.3

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>

(cherry picked from commit 3987688de6720d951bfeb0b49c364df9738b490b)
This commit is contained in:
Lubomír Sedlář 2024-11-22 15:52:59 +02:00 committed by Stepan Oksanichenko
parent 26959621a6
commit fddce94704
35 changed files with 29 additions and 111 deletions

View File

@ -7,11 +7,7 @@ import os
import shutil
import tempfile
from collections import defaultdict
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from kobo.rpmlib import parse_nvr
import unittest

View File

@ -1,5 +1,4 @@
from unittest import mock
import io
import unittest

View File

@ -1,11 +1,8 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from copy import copy
from io import StringIO
from unittest import mock
from ddt import ddt, data
import os

View File

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
from unittest import mock
import unittest
import os
from io import StringIO
from unittest import mock
import kobo.conf

View File

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
import logging
from unittest import mock
import json
import os
import shutil
import tempfile
import unittest
from unittest import mock
from requests.exceptions import HTTPError

View File

@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
import unittest
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from pungi import checks
from tests.helpers import load_config, PKGSET_REPOS

View File

@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import io
import os

View File

@ -3,11 +3,7 @@
import logging
import contextlib
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import productmd
import os

View File

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from unittest import mock
from parameterized import parameterized
import os
from io import StringIO
from unittest import mock
from parameterized import parameterized
from tests import helpers
from pungi import createiso

View File

@ -3,11 +3,7 @@
import glob
import os
import unittest
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from pungi.module_util import Modulemd
from pungi.phases.createrepo import (

View File

@ -1,14 +1,9 @@
# -*- coding: utf-8 -*-
import logging
try:
from unittest import mock
except ImportError:
import mock
from typing import AnyStr, List
import os
from unittest import mock
from typing import AnyStr, List
from tests import helpers
from pungi.createiso import CreateIsoOpts

View File

@ -3,10 +3,8 @@
import copy
import json
import os
from unittest import mock
import unittest
from unittest import mock
from pungi.phases import gather
from pungi.phases.gather import _mk_pkg_map

View File

@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
import unittest
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from pungi.phases.gather.sources.source_module import GatherSourceModule
from tests import helpers

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
from tests import helpers

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
from pungi.phases.image_build import ImageBuildPhase, CreateImageBuildThread

View File

@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
import shutil
import tempfile

View File

@ -2,12 +2,7 @@
import unittest
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
from pungi.module_util import Modulemd

View File

@ -1,9 +1,5 @@
import os
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from pungi.phases.kiwibuild import KiwiBuildPhase, RunKiwiBuildThread
from tests.helpers import DummyCompose, PungiTestCase

View File

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
import json
from unittest import mock
import unittest
import tempfile
from unittest import mock
import os
import shutil

View File

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
from unittest import mock
import errno
import os
import stat
from unittest import mock
from pungi import linker
from tests import helpers

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
from pungi.phases.livemedia_phase import LiveMediaPhase, LiveMediaThread

View File

@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
import unittest
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from pungi import media_split

View File

@ -2,9 +2,8 @@
from datetime import datetime
import json
from unittest import mock
import unittest
from unittest import mock
from pungi.notifier import PungiNotifier

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
import shutil
import tempfile

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
import shlex

View File

@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
import json
from unittest import mock
import os
from tests import helpers

View File

@ -3,12 +3,8 @@
import json
import os
try:
from unittest import mock
except ImportError:
import mock
import yaml
from unittest import mock
from tests import helpers
from pungi import ostree

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
from tests import helpers

View File

@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
import unittest

View File

@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
from unittest import mock
import unittest
import random
import time
from unittest import mock
from pungi.phases import weaver
from tests.helpers import DummyCompose, boom

View File

@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
import os
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from pungi.module_util import Modulemd
from pungi.phases.pkgset import common

View File

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
import ddt
from unittest import mock
import os
import ddt
import unittest
import json
import tempfile

View File

@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
import json
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
import re
import unittest

View File

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
import random
import shutil

View File

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
from unittest import mock
import os
import shutil
from configparser import ConfigParser
from unittest import mock
from tests.helpers import PungiTestCase, FIXTURE_DIR, touch, mk_boom
from pungi_utils import unified_isos