fix pytest issue347: slaves running on top of Python3.2

will set PYTHONDONTWRITEYBTECODE to 1 to avoid import concurrency
bugs.
This commit is contained in:
holger krekel
2013-09-05 18:52:59 +02:00
parent 45dd5975f0
commit a9aca9a3ae
2 changed files with 8 additions and 0 deletions

View File

@@ -9,6 +9,10 @@
- fix pytest issue41: re-run tests on all file changes, not just
randomly select ones like .py/.c.
- fix pytest issue347: slaves running on top of Python3.2
will set PYTHONDONTWRITEYBTECODE to 1 to avoid import concurrency
bugs.
1.8
-------------------------

View File

@@ -125,6 +125,10 @@ def remote_initconfig(option_dict, args):
if __name__ == '__channelexec__':
# python3.2 is not concurrent import safe, so let's play it safe
# https://bitbucket.org/hpk42/pytest/issue/347/pytest-xdist-and-python-32
if sys.version_info[:2] == (3,2):
os.environ["PYTHONDONTWRITEBYTECODE"] = 1
slaveinput,args,option_dict = channel.receive()
importpath = os.getcwd()
sys.path.insert(0, importpath) # XXX only for remote situations