diff options
author | oldPadavan <evggoncharov@gmail.com> | 2018-07-12 14:04:46 +0300 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2018-07-15 14:26:15 +0200 |
commit | 7f08b7730438bde34ae55bc3793fa524047bb804 (patch) | |
tree | 0f6a64a7ce6db109c4ea2884e1a850757177436b /git/test/test_repo.py | |
parent | 9807dd48b73ec43b21aa018bdbf591af4a3cc5f9 (diff) | |
download | gitpython-7f08b7730438bde34ae55bc3793fa524047bb804.tar.gz |
Allow pathlib.Path in Repo.__init__
Diffstat (limited to 'git/test/test_repo.py')
-rw-r--r-- | git/test/test_repo.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 8b43051e..e65ead89 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -110,6 +110,14 @@ class TestRepo(TestBase): assert not rw_repo.git.working_dir.endswith('.git') self.assertEqual(r_from_gitdir.git.working_dir, rw_repo.git.working_dir) + @with_rw_repo('0.3.2.1') + def test_repo_creation_pathlib(self, rw_repo): + if pathlib is None: # pythons bellow 3.4 don't have pathlib + raise SkipTest("pathlib was introduced in 3.4") + + r_from_gitdir = Repo(pathlib.Path(rw_repo.git_dir)) + self.assertEqual(r_from_gitdir.git_dir, rw_repo.git_dir) + def test_description(self): txt = "Test repository" self.rorepo.description = txt |