Skip to content

Commit 02a9371

Browse files
committed
adjust tests if py library is installed
1 parent dc0cb0d commit 02a9371

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

testing/_py/test_local.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,12 @@ def test_sysexec(self):
909909
assert out.find(x.basename) != -1
910910

911911
def test_sysexec_failing(self):
912+
try:
913+
from py._process.cmdexec import ExecutionFailed # py library
914+
except ImportError:
915+
ExecutionFailed = RuntimeError # py vendored
912916
x = local.sysfind("false")
913-
with pytest.raises(RuntimeError):
917+
with pytest.raises(ExecutionFailed):
914918
x.sysexec("aksjdkasjd")
915919

916920
def test_make_numbered_dir(self, tmpdir):
@@ -1146,7 +1150,10 @@ def test_pypkgdir_unimportable(tmpdir):
11461150

11471151

11481152
def test_isimportable():
1149-
from py.path import isimportable
1153+
try:
1154+
from py.path import isimportable # py vendored version
1155+
except ImportError:
1156+
from py._path.local import isimportable # py library
11501157

11511158
assert not isimportable("")
11521159
assert isimportable("x")

0 commit comments

Comments
 (0)