Skip to content

Commit

Permalink
Remove mock in favor of unittest.mock (#545)
Browse files Browse the repository at this point in the history
* Remove mock in favor of unittest.mock
  • Loading branch information
dbieber authored Sep 20, 2024
1 parent 9825623 commit b83fa05
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ pytest-runner <7.0.0
termcolor <2.5.0
hypothesis <6.113.0
levenshtein <=0.25.1
mock <6.0.0
3 changes: 2 additions & 1 deletion fire/core_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

"""Tests for the core module."""

from unittest import mock

from fire import core
from fire import test_components as tc
from fire import testutils
from fire import trace
import mock


class CoreTest(testutils.BaseTestCase):
Expand Down
2 changes: 1 addition & 1 deletion fire/fire_import_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"""Tests importing the fire module."""

import sys
from unittest import mock

import fire
from fire import testutils
import mock


class FireImportTest(testutils.BaseTestCase):
Expand Down
3 changes: 1 addition & 2 deletions fire/fire_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

import os
import sys
from unittest import mock

import fire
from fire import test_components as tc
from fire import testutils

import mock


class FireTest(testutils.BaseTestCase):

Expand Down
4 changes: 2 additions & 2 deletions fire/interact_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

"""Tests for the interact module."""

from unittest import mock

from fire import interact
from fire import testutils

import mock


try:
import IPython # pylint: disable=unused-import, g-import-not-at-top
Expand Down
3 changes: 1 addition & 2 deletions fire/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
import re
import sys
import unittest
from unittest import mock

from fire import core
from fire import trace

import mock


class BaseTestCase(unittest.TestCase):
"""Shared test case for Python Fire tests."""
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

TEST_DEPENDENCIES = [
'hypothesis',
'mock',
'levenshtein',
]

Expand Down

0 comments on commit b83fa05

Please sign in to comment.