2017-03-23 3 views

답변

2

env substitution을 통해 작동합니다. 어느 TOX_WORKDIR 또는 기본 사용 예 :

tox.ini을

[tox] 
envlist = py 
skipsdist = true 

[testenv] 
setenv = TOX_WORKDIR = {env:TOX_WORKDIR:.tox} 
commands = python ./envecho.py 

envecho.py

#!/usr/bin/env python 
import os 

print(os.getenv("TOX_WORKDIR")) 

ENV 미결정 출력 : ENV 세트

$ tox 

py create: /home/oliver/Dropbox/projects/tox/lab/mini/.tox/py 
py installed: appdirs==1.4.3,packaging==16.8,pyparsing==2.2.0,six==1.10.0 
py runtests: PYTHONHASHSEED='2704413679' 
py runtests: commands[0] | python ./envecho.py 
.tox 
______________________________ summary ______________________________ 
    py: commands succeeded 
    congratulations :) 

출력 :

$ TOX_WORKDIR=/tmp/ tox 

py installed: appdirs==1.4.3,packaging==16.8,pyparsing==2.2.0,six==1.10.0 
py runtests: PYTHONHASHSEED='30398946' 
py runtests: commands[0] | python ./envecho.py 
/tmp/ 
______________________________ summary ______________________________ 
    py: commands succeeded 
    congratulations :)