Skip to content

Commit 99471bb

Browse files
committed
Remove and replace assert_match with assertRegex
Also remove no longer used assert_not_none
1 parent 45a5495 commit 99471bb

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

git/test/lib/asserts.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
import re
87
from unittest.mock import patch
98

109
from nose.tools import (
@@ -16,16 +15,5 @@
1615
assert_false # @UnusedImport
1716
)
1817

19-
__all__ = ['assert_not_none', 'assert_match',
20-
'assert_equal', 'assert_not_equal', 'assert_raises', 'patch', 'raises',
18+
__all__ = ['assert_equal', 'assert_not_equal', 'assert_raises', 'patch', 'raises',
2119
'assert_true', 'assert_false']
22-
23-
24-
def assert_not_none(actual, msg=None):
25-
"""verify that item is None"""
26-
assert actual is not None, msg
27-
28-
29-
def assert_match(pattern, string, msg=None):
30-
"""verify that the pattern matches the string"""
31-
assert_not_none(re.search(pattern, string), msg)

git/test/test_git.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
raises,
2626
assert_equal,
2727
assert_true,
28-
assert_match,
2928
fixture_path
3029
)
3130
from git.test.lib import with_rw_directory
@@ -87,7 +86,7 @@ def test_it_transforms_kwargs_into_git_command_arguments(self):
8786
self.assertEqual({'-s', '-t'}, set(res))
8887

8988
def test_it_executes_git_to_shell_and_returns_result(self):
90-
assert_match(r'^git version [\d\.]{2}.*$', self.git.execute(["git", "version"]))
89+
self.assertRegex(self.git.execute(["git", "version"]), r'^git version [\d\.]{2}.*$')
9190

9291
def test_it_accepts_stdin(self):
9392
filename = fixture_path("cat_file_blob")

0 commit comments

Comments
 (0)