summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmon <Harmon758@gmail.com>2020-02-16 16:35:30 -0600
committerHarmon <Harmon758@gmail.com>2020-02-16 16:35:30 -0600
commitc8c63abb360b4829b3d75d60fb837c0132db0510 (patch)
tree7a1634e343cb122f2c043fa37bb798270ef9c2b4
parent24d04e820ef721c8036e8424acdb1a06dc1e8b11 (diff)
downloadgitpython-c8c63abb360b4829b3d75d60fb837c0132db0510.tar.gz
Replace assert_raises with assertRaises
-rw-r--r--git/test/lib/asserts.py4
-rw-r--r--git/test/test_base.py3
-rw-r--r--git/test/test_remote.py7
3 files changed, 5 insertions, 9 deletions
diff --git a/git/test/lib/asserts.py b/git/test/lib/asserts.py
index 789c681b..d9673147 100644
--- a/git/test/lib/asserts.py
+++ b/git/test/lib/asserts.py
@@ -7,11 +7,9 @@
from unittest.mock import patch
from nose.tools import (
- assert_raises, # @UnusedImport
raises, # @UnusedImport
assert_true, # @UnusedImport
assert_false # @UnusedImport
)
-__all__ = ['assert_raises', 'patch', 'raises',
- 'assert_true', 'assert_false']
+__all__ = ['patch', 'raises', 'assert_true', 'assert_false']
diff --git a/git/test/test_base.py b/git/test/test_base.py
index 2132806b..ee2e8e07 100644
--- a/git/test/test_base.py
+++ b/git/test/test_base.py
@@ -19,7 +19,6 @@ from git.compat import is_win
from git.objects.util import get_object_type_by_name
from git.test.lib import (
TestBase,
- assert_raises,
with_rw_repo,
with_rw_and_rw_remote_repo
)
@@ -96,7 +95,7 @@ class TestBase(TestBase):
assert base.Object in get_object_type_by_name(tname).mro()
# END for each known type
- assert_raises(ValueError, get_object_type_by_name, b"doesntexist")
+ self.assertRaises(ValueError, get_object_type_by_name, b"doesntexist")
def test_object_resolution(self):
# objects must be resolved to shas so they compare equal
diff --git a/git/test/test_remote.py b/git/test/test_remote.py
index 13828489..c659dd32 100644
--- a/git/test/test_remote.py
+++ b/git/test/test_remote.py
@@ -27,8 +27,7 @@ from git.test.lib import (
with_rw_repo,
with_rw_and_rw_remote_repo,
fixture,
- GIT_DAEMON_PORT,
- assert_raises
+ GIT_DAEMON_PORT
)
from git.util import rmtree, HIDE_WINDOWS_FREEZE_ERRORS
import os.path as osp
@@ -626,7 +625,7 @@ class TestRemote(TestBase):
self.assertEqual(list(remote.urls), [test1, test2])
# will raise: fatal: --add --delete doesn't make sense
- assert_raises(GitCommandError, remote.set_url, test2, add=True, delete=True)
+ self.assertRaises(GitCommandError, remote.set_url, test2, add=True, delete=True)
# Testing on another remote, with the add/delete URL
remote = rw_repo.create_remote('another', url=test1)
@@ -640,7 +639,7 @@ class TestRemote(TestBase):
remote.delete_url(test1)
self.assertEqual(list(remote.urls), [test3])
# will raise fatal: Will not delete all non-push URLs
- assert_raises(GitCommandError, remote.delete_url, test3)
+ self.assertRaises(GitCommandError, remote.delete_url, test3)
def test_fetch_error(self):
rem = self.rorepo.remote('origin')