aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorFloris Bruynooghe <flub@devork.be>2019-11-17 17:41:34 +0100
committerDavid Bremner <david@tethera.net>2019-12-03 08:12:30 -0400
commita950aa28449feef76246ad2b64224fd72e2e574c (patch)
treec502f92bdc2449fcdc399eb372bff55712d52118 /bindings
parentfbb8e1f4301f0993cf0b477b8e0e40d2273e3523 (diff)
Show which notmuch command and version is being used
This add the notmuch version and absolute path of the binary used in the pytest header. This is nice when running the tests interactively as you get confirmation you're testing the version you thought you were testing.
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python-cffi/tests/conftest.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py
index aa940947..674c7218 100644
--- a/bindings/python-cffi/tests/conftest.py
+++ b/bindings/python-cffi/tests/conftest.py
@@ -10,6 +10,13 @@ import os
import pytest
+def pytest_report_header():
+ 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())]
+
+
@pytest.fixture(scope='function')
def tmppath(tmpdir):
"""The tmpdir fixture wrapped in pathlib.Path."""