]> git.cworth.org Git - notmuch-old/blobdiff - bindings/python-cffi/tests/conftest.py
python-cffi: use shutil.which
[notmuch-old] / bindings / python-cffi / tests / conftest.py
index 674c72187078507b57edb0070a73aef635397ac7..e322cc647167e917b99a8a537b4c9b1b7100a04b 100644 (file)
@@ -1,6 +1,7 @@
 import email.message
 import mailbox
 import pathlib
+import shutil
 import socket
 import subprocess
 import textwrap
@@ -11,10 +12,9 @@ import pytest
 
 
 def pytest_report_header():
+    which = shutil.which('notmuch')
     vers = subprocess.run(['notmuch', '--version'], stdout=subprocess.PIPE)
-    which = subprocess.run(['which', 'notmuch'], stdout=subprocess.PIPE)
-    return ['{} ({})'.format(vers.stdout.decode(errors='replace').strip(),
-                             which.stdout.decode(errors='replace').strip())]
+    return ['{} ({})'.format(vers.stdout.decode(errors='replace').strip(),which)]
 
 
 @pytest.fixture(scope='function')