import email.message
import mailbox
import pathlib
+import shutil
import socket
import subprocess
import textwrap
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')
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
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
exclude_tags=deleted;spam;
[maildir]
synchronize_flags=true
- [crypto]
- gpg_path=gpg
""".format(tmppath=tmppath)))
return MailDir(tmppath)