| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | 7 | # flake8: noqa | |
| 8 | 8 | import inspect | |
| 9 | - from .asserts import * | ||
| 10 | 9 | from .helper import * | |
| 11 | 10 | ||
| 12 | 11 | __all__ = [name for name, obj in locals().items() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,6 @@ | |||
| 21 | 21 | from git.compat import is_darwin | |
| 22 | 22 | from git.test.lib import ( | |
| 23 | 23 | TestBase, | |
| 24 | - patch, | ||
| 25 | 24 | fixture_path | |
| 26 | 25 | ) | |
| 27 | 26 | from git.test.lib import with_rw_directory | |
@@ -43,7 +42,7 @@ def tearDown(self): | |||
| 43 | 42 | import gc | |
| 44 | 43 | gc.collect() | |
| 45 | 44 | ||
| 46 | - @patch.object(Git, 'execute') | ||
| 45 | + @mock.patch.object(Git, 'execute') | ||
| 47 | 46 | def test_call_process_calls_execute(self, git): | |
| 48 | 47 | git.return_value = '' | |
| 49 | 48 | self.git.version() | |
@@ -90,7 +89,7 @@ def test_it_accepts_stdin(self): | |||
| 90 | 89 | self.assertEqual("70c379b63ffa0795fdbfbc128e5a2818397b7ef8", | |
| 91 | 90 | self.git.hash_object(istream=fh, stdin=True)) | |
| 92 | 91 | ||
| 93 | - @patch.object(Git, 'execute') | ||
| 92 | + @mock.patch.object(Git, 'execute') | ||
| 94 | 93 | def test_it_ignores_false_kwargs(self, git): | |
| 95 | 94 | # this_should_not_be_ignored=False implies it *should* be ignored | |
| 96 | 95 | self.git.version(pass_this_kwarg=False) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ | |||
| 12 | 12 | import pathlib | |
| 13 | 13 | import pickle | |
| 14 | 14 | import tempfile | |
| 15 | - from unittest import skipIf, SkipTest | ||
| 15 | + from unittest import mock, skipIf, SkipTest | ||
| 16 | 16 | ||
| 17 | 17 | from git import ( | |
| 18 | 18 | InvalidGitRepositoryError, | |
@@ -37,7 +37,6 @@ | |||
| 37 | 37 | ) | |
| 38 | 38 | from git.repo.fun import touch | |
| 39 | 39 | from git.test.lib import ( | |
| 40 | - patch, | ||
| 41 | 40 | TestBase, | |
| 42 | 41 | with_rw_repo, | |
| 43 | 42 | fixture | |
@@ -393,7 +392,7 @@ def test_archive(self): | |||
| 393 | 392 | assert stream.tell() | |
| 394 | 393 | os.remove(tmpfile) | |
| 395 | 394 | ||
| 396 | - @patch.object(Git, '_call_process') | ||
| 395 | + @mock.patch.object(Git, '_call_process') | ||
| 397 | 396 | def test_should_display_blame_information(self, git): | |
| 398 | 397 | git.return_value = fixture('blame') | |
| 399 | 398 | b = self.rorepo.blame('master', 'lib/git.py') | |
@@ -437,7 +436,7 @@ def test_blame_real(self): | |||
| 437 | 436 | assert c, "Should have executed at least one blame command" | |
| 438 | 437 | assert nml, "There should at least be one blame commit that contains multiple lines" | |
| 439 | 438 | ||
| 440 | - @patch.object(Git, '_call_process') | ||
| 439 | + @mock.patch.object(Git, '_call_process') | ||
| 441 | 440 | def test_blame_incremental(self, git): | |
| 442 | 441 | # loop over two fixtures, create a test fixture for 2.11.1+ syntax | |
| 443 | 442 | for git_fixture in ('blame_incremental', 'blame_incremental_2.11.1_plus'): | |
@@ -460,7 +459,7 @@ def test_blame_incremental(self, git): | |||
| 460 | 459 | orig_ranges = flatten([entry.orig_linenos for entry in blame_output]) | |
| 461 | 460 | self.assertEqual(orig_ranges, flatten([range(2, 3), range(14, 15), range(1, 2), range(2, 13), range(13, 15)])) # noqa E501 | |
| 462 | 461 | ||
| 463 | - @patch.object(Git, '_call_process') | ||
| 462 | + @mock.patch.object(Git, '_call_process') | ||
| 464 | 463 | def test_blame_complex_revision(self, git): | |
| 465 | 464 | git.return_value = fixture('blame_complex_revision') | |
| 466 | 465 | res = self.rorepo.blame("HEAD~10..HEAD", "README.md") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments