| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,9 +7,8 @@ | |||
| 7 | 7 | from unittest.mock import patch | |
| 8 | 8 | ||
| 9 | 9 | from nose.tools import ( | |
| 10 | - raises, # @UnusedImport | ||
| 11 | 10 | assert_true, # @UnusedImport | |
| 12 | 11 | assert_false # @UnusedImport | |
| 13 | 12 | ) | |
| 14 | 13 | ||
| 15 | - __all__ = ['patch', 'raises', 'assert_true', 'assert_false'] | ||
| 14 | + __all__ = ['patch', 'assert_true', 'assert_false'] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,6 @@ | |||
| 22 | 22 | from git.test.lib import ( | |
| 23 | 23 | TestBase, | |
| 24 | 24 | patch, | |
| 25 | - raises, | ||
| 26 | 25 | assert_true, | |
| 27 | 26 | fixture_path | |
| 28 | 27 | ) | |
@@ -62,9 +61,8 @@ def test_call_unpack_args(self): | |||
| 62 | 61 | mangled_value = 'Unicode\u20ac\u2122' | |
| 63 | 62 | self.assertEqual(args, ['git', 'log', '--', mangled_value]) | |
| 64 | 63 | ||
| 65 | - @raises(GitCommandError) | ||
| 66 | 64 | def test_it_raises_errors(self): | |
| 67 | - self.git.this_does_not_exist() | ||
| 65 | + self.assertRaises(GitCommandError, self.git.this_does_not_exist) | ||
| 68 | 66 | ||
| 69 | 67 | def test_it_transforms_kwargs_into_git_command_arguments(self): | |
| 70 | 68 | self.assertEqual(["-s"], self.git.transform_kwargs(**{'s': True})) | |
@@ -99,10 +97,9 @@ def test_it_ignores_false_kwargs(self, git): | |||
| 99 | 97 | self.git.version(pass_this_kwarg=False) | |
| 100 | 98 | assert_true("pass_this_kwarg" not in git.call_args[1]) | |
| 101 | 99 | ||
| 102 | - @raises(GitCommandError) | ||
| 103 | 100 | def test_it_raises_proper_exception_with_output_stream(self): | |
| 104 | 101 | tmp_file = TemporaryFile() | |
| 105 | - self.git.checkout('non-existent-branch', output_stream=tmp_file) | ||
| 102 | + self.assertRaises(GitCommandError, self.git.checkout, 'non-existent-branch', output_stream=tmp_file) | ||
| 106 | 103 | ||
| 107 | 104 | def test_it_accepts_environment_variables(self): | |
| 108 | 105 | filename = fixture_path("ls_tree_empty") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,8 +42,7 @@ | |||
| 42 | 42 | with_rw_repo, | |
| 43 | 43 | fixture, | |
| 44 | 44 | assert_false, | |
| 45 | - assert_true, | ||
| 46 | - raises | ||
| 45 | + assert_true | ||
| 47 | 46 | ) | |
| 48 | 47 | from git.util import HIDE_WINDOWS_KNOWN_ERRORS, cygpath | |
| 49 | 48 | from git.test.lib import with_rw_directory | |
@@ -82,13 +81,11 @@ def tearDown(self): | |||
| 82 | 81 | import gc | |
| 83 | 82 | gc.collect() | |
| 84 | 83 | ||
| 85 | - @raises(InvalidGitRepositoryError) | ||
| 86 | 84 | def test_new_should_raise_on_invalid_repo_location(self): | |
| 87 | - Repo(tempfile.gettempdir()) | ||
| 85 | + self.assertRaises(InvalidGitRepositoryError, Repo, tempfile.gettempdir()) | ||
| 88 | 86 | ||
| 89 | - @raises(NoSuchPathError) | ||
| 90 | 87 | def test_new_should_raise_on_non_existent_path(self): | |
| 91 | - Repo("repos/foobar") | ||
| 88 | + self.assertRaises(NoSuchPathError, Repo, "repos/foobar") | ||
| 92 | 89 | ||
| 93 | 90 | @with_rw_repo('0.3.2.1') | |
| 94 | 91 | def test_repo_creation_from_different_paths(self, rw_repo): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments