aboutsummaryrefslogtreecommitdiff
path: root/bindings/python-cffi/tests
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2019-11-25 20:47:24 -0400
committerDavid Bremner <david@tethera.net>2019-12-03 08:12:30 -0400
commit3185830e3afaa238d0c79220fcefea8800b8cf85 (patch)
treed25c8e19fa485aa945d24257a082c29192c08ba1 /bindings/python-cffi/tests
parent1e072204cd1963fbf684cdc9c92092efb2d44924 (diff)
python-cffi: use shutil.which
I was supposed to amend the original patch that added this function, but somehow I botched that. The original version runs, so make an extra commit for the tidying.
Diffstat (limited to 'bindings/python-cffi/tests')
-rw-r--r--bindings/python-cffi/tests/conftest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py
index 674c7218..e322cc64 100644
--- a/bindings/python-cffi/tests/conftest.py
+++ b/bindings/python-cffi/tests/conftest.py
@@ -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')