Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Use builtin 'unittest.mock' instead of 'mock'
Browse files Browse the repository at this point in the history
  • Loading branch information
locriandev committed Dec 14, 2022
1 parent a5e7a59 commit 2d52575
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 16 deletions.
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ autopep8
coverage
flake8
flexmock
mock
pygit2 == 1.10.1 # https://github.com/libgit2/pygit2/issues/1176
pylint
pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_gen_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from flexmock import flexmock

import io
from mock import AsyncMock
from unittest.mock import AsyncMock
import yaml
import openshift as oc

Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_rpms_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import io

import asynctest
from mock import AsyncMock, MagicMock, Mock, patch
from unittest.mock import AsyncMock, MagicMock, Mock, patch

from doozerlib import gitdata, rpmcfg
from doozerlib.cli.rpms_build import _rpms_rebase_and_build
Expand Down
2 changes: 1 addition & 1 deletion tests/test_brew_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging

import unittest
from mock import MagicMock, Mock, patch
from unittest.mock import MagicMock, Mock, patch

from doozerlib.image import BrewBuildImageInspector

Expand Down
1 change: 0 additions & 1 deletion tests/test_dblib.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pathlib
import traceback
import sys
import mock


class FakeMetaData(object):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_distgit/test_generic_distgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest

from flexmock import flexmock
import mock
from unittest import mock

from doozerlib import distgit, model
from doozerlib.assembly import AssemblyTypes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from unittest.mock import Mock, patch

from flexmock import flexmock
from mock import MagicMock
from unittest.mock import MagicMock

from doozerlib import distgit, model
from doozerlib.assembly import AssemblyTypes
Expand Down
2 changes: 1 addition & 1 deletion tests/test_distgit/test_rpm_distgit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from pathlib import Path

from mock import Mock, patch
from unittest.mock import Mock, patch

from doozerlib import distgit, model

Expand Down
2 changes: 1 addition & 1 deletion tests/test_exectools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import unittest

import asynctest
import mock
from unittest import mock

try:
from importlib import reload
Expand Down
2 changes: 1 addition & 1 deletion tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
import tempfile
import shutil
import mock
from unittest import mock
from flexmock import flexmock
try:
from importlib import reload
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
import datetime

from mock import MagicMock, Mock, patch
from unittest.mock import MagicMock, Mock, patch

from doozerlib.metadata import Metadata, CgitAtomFeedEntry, RebuildHintCode
from doozerlib.brew import BuildStates
Expand Down
2 changes: 1 addition & 1 deletion tests/test_olm_bundle.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

from flexmock import flexmock
from mock import MagicMock
from unittest.mock import MagicMock

from doozerlib.olm.bundle import OLMBundle

Expand Down
3 changes: 1 addition & 2 deletions tests/test_plashet.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from unittest import TestCase

from mock import MagicMock, Mock
from mock.mock import patch
from unittest.mock import MagicMock, Mock, patch

from doozerlib.model import Model
from doozerlib.plashet import PlashetBuilder
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rpm_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path

import asynctest
import mock
from unittest import mock

from doozerlib import distgit, gitdata, rpmcfg
from doozerlib.exectools import RetryException
Expand Down
2 changes: 1 addition & 1 deletion tests/test_source_modifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import tempfile
import unittest

import mock
from unittest import mock
import yaml.scanner

from doozerlib.source_modifications import (AddModifier, RemoveModifier,
Expand Down

0 comments on commit 2d52575

Please sign in to comment.