]> git.notmuchmail.org Git - notmuch/commitdiff
Show which notmuch command and version is being used
authorFloris Bruynooghe <flub@devork.be>
Sun, 17 Nov 2019 16:41:34 +0000 (17:41 +0100)
committerDavid Bremner <david@tethera.net>
Tue, 3 Dec 2019 12:12:30 +0000 (08:12 -0400)
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.

bindings/python-cffi/tests/conftest.py

index aa940947ca56502d93a73e71e5085047f8201e98..674c72187078507b57edb0070a73aef635397ac7 100644 (file)
@@ -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."""