Directly import mock from unittest

It is not a separate package since Python 3.3

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2024-11-22 14:52:59 +01:00 committed by lsedlar
parent 7d51229361
commit 3987688de6
46 changed files with 48 additions and 227 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,9 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import unittest
from pungi.arch import (

View file

@ -1,8 +1,4 @@
try:
from unittest import mock
except ImportError:
import mock
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
import os

View file

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

View file

@ -1,17 +1,12 @@
# -*- coding: utf-8 -*-
import logging
try:
from unittest import mock
except ImportError:
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,13 +1,10 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
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,9 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
from productmd.extra_files import ExtraFiles

View file

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

View file

@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
from pungi.phases.gather.methods import method_deps as deps
from tests import helpers

View file

@ -2,11 +2,7 @@
from collections import namedtuple
import copy
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
from pungi.phases.gather.methods import method_hybrid as hybrid

View file

@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
from pungi.phases.gather.methods import method_nodeps as nodeps

View file

@ -3,13 +3,8 @@
import copy
import json
import os
try:
from unittest import mock
except ImportError:
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,10 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
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
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,11 +1,7 @@
# -*- coding: utf-8 -*-
import itertools
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
import unittest

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,14 +1,9 @@
# -*- coding: utf-8 -*-
import json
try:
from unittest import mock
except ImportError:
import mock
import unittest
import tempfile
from unittest import mock
import os
import shutil

View file

@ -1,13 +1,9 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
import errno
import os
import stat
from unittest import mock
from pungi import linker
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
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

@ -1,7 +1,4 @@
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
from tests import helpers

View file

@ -2,13 +2,8 @@
from datetime import datetime
import json
try:
from unittest import mock
except ImportError:
import mock
import unittest
from unittest import mock
from pungi.notifier import PungiNotifier

View file

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

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

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

View file

@ -1,13 +1,7 @@
# -*- coding: utf-8 -*-
import json
try:
from unittest import mock
except ImportError:
import mock
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,10 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
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,13 +1,9 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
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,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
import unittest

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,9 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
from pungi.runroot import Runroot

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 random
import shutil

View file

@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
import mock
from unittest import mock
import os
import pungi.phases.test as test_phase

View file

@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
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

View file

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