X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bindings%2Fpython-cffi%2Ftests%2Fconftest.py;h=de7db8e795d04cce1022a94722f7a66e250164fe;hb=HEAD;hp=674c72187078507b57edb0070a73aef635397ac7;hpb=a950aa28449feef76246ad2b64224fd72e2e574c;p=notmuch diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py index 674c7218..fe90c787 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') @@ -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)