Skip to content

Commit 909ee3b

Browse files
committed
Remove outdated checks for unittest.mock existence
1 parent 7d94159 commit 909ee3b

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

git/test/lib/asserts.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import re
88
import stat
9+
from unittest.mock import patch
910

1011
from nose.tools import (
1112
assert_equal, # @UnusedImport
@@ -16,11 +17,6 @@
1617
assert_false # @UnusedImport
1718
)
1819

19-
try:
20-
from unittest.mock import patch
21-
except ImportError:
22-
from mock import patch # @NoMove @UnusedImport
23-
2420
__all__ = ['assert_instance_of', 'assert_not_instance_of',
2521
'assert_none', 'assert_not_none',
2622
'assert_match', 'assert_not_match', 'assert_mode_644',

git/test/test_commit.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import re
1212
import sys
1313
import time
14+
from unittest.mock import Mock
1415

1516
from git import (
1617
Commit,
@@ -33,12 +34,6 @@
3334
import os.path as osp
3435

3536

36-
try:
37-
from unittest.mock import Mock
38-
except ImportError:
39-
from mock import Mock
40-
41-
4237
def assert_commit_serialization(rwrepo, commit_id, print_performance_info=False):
4338
"""traverse all commits in the history of commit identified by commit_id and check
4439
if the serialization works.

git/test/test_git.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import subprocess
99
import sys
1010
from tempfile import TemporaryFile
11+
from unittest import mock
1112

1213
from git import (
1314
Git,
@@ -32,12 +33,6 @@
3233

3334
import os.path as osp
3435

35-
36-
try:
37-
from unittest import mock
38-
except ImportError:
39-
import mock
40-
4136
from git.compat import is_win
4237

4338

0 commit comments

Comments
 (0)