Skip to content

Commit

Permalink
adjust tests if py library is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Oct 20, 2022
1 parent dc0cb0d commit 02a9371
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions testing/_py/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,12 @@ def test_sysexec(self):
assert out.find(x.basename) != -1

def test_sysexec_failing(self):
try:
from py._process.cmdexec import ExecutionFailed # py library
except ImportError:
ExecutionFailed = RuntimeError # py vendored
x = local.sysfind("false")
with pytest.raises(RuntimeError):
with pytest.raises(ExecutionFailed):
x.sysexec("aksjdkasjd")

def test_make_numbered_dir(self, tmpdir):
Expand Down Expand Up @@ -1146,7 +1150,10 @@ def test_pypkgdir_unimportable(tmpdir):


def test_isimportable():
from py.path import isimportable
try:
from py.path import isimportable # py vendored version
except ImportError:
from py._path.local import isimportable # py library

assert not isimportable("")
assert isimportable("x")
Expand Down

0 comments on commit 02a9371

Please sign in to comment.