Skip to content

Commit 87abade

Browse files
committed
Remove checks for pathlib existence in TestRepo for Python < 3.4
1 parent b17a767 commit 87abade

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

git/test/test_repo.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@
99
from io import BytesIO
1010
import itertools
1111
import os
12+
import pathlib
1213
import pickle
1314
import tempfile
1415
from unittest import skipIf, SkipTest
1516

16-
try:
17-
import pathlib
18-
except ImportError:
19-
pathlib = None
20-
2117
from git import (
2218
InvalidGitRepositoryError,
2319
Repo,
@@ -105,9 +101,6 @@ def test_repo_creation_from_different_paths(self, rw_repo):
105101

106102
@with_rw_repo('0.3.2.1')
107103
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-
111104
r_from_gitdir = Repo(pathlib.Path(rw_repo.git_dir))
112105
self.assertEqual(r_from_gitdir.git_dir, rw_repo.git_dir)
113106

@@ -221,18 +214,12 @@ def test_date_format(self, rw_dir):
221214

222215
@with_rw_directory
223216
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-
227217
original_repo = Repo.init(osp.join(rw_dir, "repo"))
228218

229219
Repo.clone_from(original_repo.git_dir, pathlib.Path(rw_dir) / "clone_pathlib")
230220

231221
@with_rw_directory
232222
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-
236223
original_repo = Repo.init(osp.join(rw_dir, "repo"))
237224

238225
cloned = Repo.clone_from(original_repo.git_dir, pathlib.Path(rw_dir) / "clone_pathlib_withConfig",

0 commit comments

Comments
 (0)