Skip to content

Commit eab7351

Browse files
fndariflorisla
authored andcommitted
Make Travis happy for Python 2.7 and pypy
1 parent a831930 commit eab7351

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/context.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,18 @@ class Oops(Exception):
209209

210210
@patch(local_path)
211211
def cd_should_accept_pathlib_path_objects(self, Local):
212-
from pathlib import Path
212+
try:
213+
from pathlib import Path
214+
except ImportError:
215+
# for Python 2.7 and pypy
216+
# in this case, this test will be redundant
217+
test_path = "foo"
218+
else:
219+
test_path = Path("foo")
213220

214221
runner = Local.return_value
215222
c = Context()
216223

217-
test_path = Path("foo")
218224
with c.cd(test_path):
219225
c.run("whoami")
220226

0 commit comments

Comments
 (0)