|
9 | 9 | from io import BytesIO |
10 | 10 | import itertools |
11 | 11 | import os |
| 12 | +import pathlib |
12 | 13 | import pickle |
13 | 14 | import tempfile |
14 | 15 | from unittest import skipIf, SkipTest |
15 | 16 |
|
16 | | -try: |
17 | | - import pathlib |
18 | | -except ImportError: |
19 | | - pathlib = None |
20 | | - |
21 | 17 | from git import ( |
22 | 18 | InvalidGitRepositoryError, |
23 | 19 | Repo, |
@@ -105,9 +101,6 @@ def test_repo_creation_from_different_paths(self, rw_repo): |
105 | 101 |
|
106 | 102 | @with_rw_repo('0.3.2.1') |
107 | 103 | def test_repo_creation_pathlib(self, rw_repo): |
108 | | - if pathlib is None: # pythons bellow 3.4 don't have pathlib |
109 | | - raise SkipTest("pathlib was introduced in 3.4") |
110 | | - |
111 | 104 | r_from_gitdir = Repo(pathlib.Path(rw_repo.git_dir)) |
112 | 105 | self.assertEqual(r_from_gitdir.git_dir, rw_repo.git_dir) |
113 | 106 |
|
@@ -221,18 +214,12 @@ def test_date_format(self, rw_dir): |
221 | 214 |
|
222 | 215 | @with_rw_directory |
223 | 216 | def test_clone_from_pathlib(self, rw_dir): |
224 | | - if pathlib is None: # pythons bellow 3.4 don't have pathlib |
225 | | - raise SkipTest("pathlib was introduced in 3.4") |
226 | | - |
227 | 217 | original_repo = Repo.init(osp.join(rw_dir, "repo")) |
228 | 218 |
|
229 | 219 | Repo.clone_from(original_repo.git_dir, pathlib.Path(rw_dir) / "clone_pathlib") |
230 | 220 |
|
231 | 221 | @with_rw_directory |
232 | 222 | def test_clone_from_pathlib_withConfig(self, rw_dir): |
233 | | - if pathlib is None: # pythons bellow 3.4 don't have pathlib |
234 | | - raise SkipTest("pathlib was introduced in 3.4") |
235 | | - |
236 | 223 | original_repo = Repo.init(osp.join(rw_dir, "repo")) |
237 | 224 |
|
238 | 225 | cloned = Repo.clone_from(original_repo.git_dir, pathlib.Path(rw_dir) / "clone_pathlib_withConfig", |
|
0 commit comments