8000 Remove and replace assert_match with assertRegex · AlanCoding/GitPython@99471bb · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Lines changed: 1 addition & 13 deletions
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

Lines changed: 1 addition & 2 deletions
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)
0