]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python-cffi/tests/conftest.py
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / bindings / python-cffi / tests / conftest.py
index 674c72187078507b57edb0070a73aef635397ac7..fe90c7879d8ad7ef0babb85386d7c87c2706a47c 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')
@@ -31,7 +31,7 @@ def notmuch(maildir):
     fixture.
     """
     def run(*args):
-        """Run a notmuch comand.
+        """Run a notmuch command.
 
         This function runs with a timeout error as many notmuch
         commands may block if multiple processes are trying to open
@@ -43,7 +43,7 @@ def notmuch(maildir):
         env = os.environ.copy()
         env['NOTMUCH_CONFIG'] = str(cfg_fname)
         proc = subprocess.run(cmd,
-                              timeout=5,
+                              timeout=120,
                               env=env)
         proc.check_returncode()
     return run
@@ -78,8 +78,6 @@ def maildir(tmppath):
             exclude_tags=deleted;spam;
             [maildir]
             synchronize_flags=true
-            [crypto]
-            gpg_path=gpg
             """.format(tmppath=tmppath)))
     return MailDir(tmppath)