Skip to content

Commit cec7440

Browse files
committed
Test installation of d2 in a cross-platform way (#279)
1 parent 492759c commit cec7440

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

test/plugin_d2/test_t2.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@
1414
REQUIRED = "d2"
1515

1616
import pytest
17-
import subprocess
17+
import shutil
1818

1919
def is_d2_installed():
20-
try:
21-
subprocess.run(["brew", "list", REQUIRED], check=True,
22-
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
23-
return True
24-
except subprocess.CalledProcessError:
25-
return False
20+
return shutil.which("d2") is not None
2621

2722

2823
import test

0 commit comments

Comments
 (0)