diff options
Diffstat (limited to 'git/test')
-rw-r--r-- | git/test/lib/helper.py | 6 | ||||
-rw-r--r-- | git/test/test_commit.py | 7 | ||||
-rw-r--r-- | git/test/test_config.py | 3 | ||||
-rw-r--r-- | git/test/test_index.py | 4 | ||||
-rw-r--r-- | git/test/test_remote.py | 5 | ||||
-rw-r--r-- | git/test/test_repo.py | 3 | ||||
-rw-r--r-- | git/test/test_submodule.py | 4 | ||||
-rw-r--r-- | git/test/test_util.py | 4 |
8 files changed, 15 insertions, 21 deletions
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index 1c06010f..d7a4c436 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -17,7 +17,7 @@ import textwrap import time import unittest -from git.compat import string_types, is_win +from git.compat import is_win from git.util import rmtree, cwd import gitdb @@ -117,7 +117,7 @@ def with_rw_repo(working_tree_ref, bare=False): To make working with relative paths easier, the cwd will be set to the working dir of the repository. """ - assert isinstance(working_tree_ref, string_types), "Decorator requires ref name for working tree checkout" + assert isinstance(working_tree_ref, str), "Decorator requires ref name for working tree checkout" def argument_passer(func): @wraps(func) @@ -248,7 +248,7 @@ def with_rw_and_rw_remote_repo(working_tree_ref): """ from git import Git, Remote # To avoid circular deps. - assert isinstance(working_tree_ref, string_types), "Decorator requires ref name for working tree checkout" + assert isinstance(working_tree_ref, str), "Decorator requires ref name for working tree checkout" def argument_passer(func): diff --git a/git/test/test_commit.py b/git/test/test_commit.py index 96a03b20..ca84f6d7 100644 --- a/git/test/test_commit.py +++ b/git/test/test_commit.py @@ -17,10 +17,7 @@ from git import ( Actor, ) from git import Repo -from git.compat import ( - string_types, - text_type -) +from git.compat import text_type from git.objects.util import tzoffset, utc from git.repo.fun import touch from git.test.lib import ( @@ -276,7 +273,7 @@ class TestCommit(TestBase): def test_name_rev(self): name_rev = self.rorepo.head.commit.name_rev - assert isinstance(name_rev, string_types) + assert isinstance(name_rev, str) @with_rw_repo('HEAD', bare=True) def test_serialization(self, rwrepo): diff --git a/git/test/test_config.py b/git/test/test_config.py index 83e510be..ce7a2cde 100644 --- a/git/test/test_config.py +++ b/git/test/test_config.py @@ -10,7 +10,6 @@ import io from git import ( GitConfigParser ) -from git.compat import string_types from git.config import _OMD, cp from git.test.lib import ( TestCase, @@ -157,7 +156,7 @@ class TestBase(TestCase): num_options += 1 val = r_config.get(section, option) val_typed = r_config.get_value(section, option) - assert isinstance(val_typed, (bool, int, float, ) + string_types) + assert isinstance(val_typed, (bool, int, float, str)) assert val assert "\n" not in option assert "\n" not in val diff --git a/git/test/test_index.py b/git/test/test_index.py index 4a23ceb1..0a2309f9 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -25,7 +25,7 @@ from git import ( GitCommandError, CheckoutError, ) -from git.compat import string_types, is_win +from git.compat import is_win from git.exc import ( HookExecutionError, InvalidGitRepositoryError @@ -388,7 +388,7 @@ class TestIndex(TestBase): self.assertEqual(len(e.failed_files), 1) self.assertEqual(e.failed_files[0], osp.basename(test_file)) self.assertEqual(len(e.failed_files), len(e.failed_reasons)) - self.assertIsInstance(e.failed_reasons[0], string_types) + self.assertIsInstance(e.failed_reasons[0], str) self.assertEqual(len(e.valid_files), 0) with open(test_file, 'rb') as fd: s = fd.read() diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 3ef47472..2194daec 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -22,7 +22,6 @@ from git import ( GitCommandError ) from git.cmd import Git -from git.compat import string_types from git.test.lib import ( TestBase, with_rw_repo, @@ -116,7 +115,7 @@ class TestRemote(TestBase): self.assertGreater(len(results), 0) self.assertIsInstance(results[0], FetchInfo) for info in results: - self.assertIsInstance(info.note, string_types) + self.assertIsInstance(info.note, str) if isinstance(info.ref, Reference): self.assertTrue(info.flags) # END reference type flags handling @@ -133,7 +132,7 @@ class TestRemote(TestBase): self.assertIsInstance(results[0], PushInfo) for info in results: self.assertTrue(info.flags) - self.assertIsInstance(info.summary, string_types) + self.assertIsInstance(info.summary, str) if info.old_commit is not None: self.assertIsInstance(info.old_commit, Commit) if info.flags & info.ERROR: diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 2d38f150..8ea18aa4 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -38,7 +38,6 @@ from git import ( ) from git.compat import ( is_win, - string_types, win_encode, ) from git.exc import ( @@ -441,7 +440,7 @@ class TestRepo(TestBase): # test the 'lines per commit' entries tlist = b[0][1] assert_true(tlist) - assert_true(isinstance(tlist[0], string_types)) + assert_true(isinstance(tlist[0], str)) assert_true(len(tlist) < sum(len(t) for t in tlist)) # test for single-char bug # BINARY BLAME diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 94028d83..0d306edc 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -8,7 +8,7 @@ from unittest import skipIf import git from git.cmd import Git -from git.compat import string_types, is_win +from git.compat import is_win from git.exc import ( InvalidGitRepositoryError, RepositoryDirtyError @@ -79,7 +79,7 @@ class TestSubmodule(TestBase): self.failUnlessRaises(InvalidGitRepositoryError, getattr, sm, 'branch') # branch_path works, as its just a string - assert isinstance(sm.branch_path, string_types) + assert isinstance(sm.branch_path, str) # some commits earlier we still have a submodule, but its at a different commit smold = next(Submodule.iter_items(rwrepo, self.k_subm_changed)) diff --git a/git/test/test_util.py b/git/test/test_util.py index a4d9d7ad..5faeeacb 100644 --- a/git/test/test_util.py +++ b/git/test/test_util.py @@ -13,7 +13,7 @@ from datetime import datetime import ddt from git.cmd import dashify -from git.compat import string_types, is_win +from git.compat import is_win from git.objects.util import ( altz_to_utctz_str, utctz_to_altz, @@ -187,7 +187,7 @@ class TestUtils(TestBase): # now that we are here, test our conversion functions as well utctz = altz_to_utctz_str(offset) - self.assertIsInstance(utctz, string_types) + self.assertIsInstance(utctz, str) self.assertEqual(utctz_to_altz(verify_utctz(utctz)), offset) # END assert rval utility |