mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
bindings/python-cffi: preserve environment for tests
We'll need this e.g. to pass PATH to the pytest tests Based on the suggested approach in id:87d0eljggj.fsf@powell.devork.be
This commit is contained in:
parent
83c2d15898
commit
e8cb7c7f60
1 changed files with 4 additions and 2 deletions
|
@ -5,6 +5,7 @@ import socket
|
|||
import subprocess
|
||||
import textwrap
|
||||
import time
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -32,10 +33,11 @@ def notmuch(maildir):
|
|||
"""
|
||||
cfg_fname = maildir.path / 'notmuch-config'
|
||||
cmd = ['notmuch'] + list(args)
|
||||
print('Invoking: {}'.format(' '.join(cmd)))
|
||||
env = os.environ.copy()
|
||||
env['NOTMUCH_CONFIG'] = str(cfg_fname)
|
||||
proc = subprocess.run(cmd,
|
||||
timeout=5,
|
||||
env={'NOTMUCH_CONFIG': str(cfg_fname)})
|
||||
env=env)
|
||||
proc.check_returncode()
|
||||
return run
|
||||
|
||||
|
|
Loading…
Reference in a new issue