kar*_*102 0 python
在终端中,我设置了www站点和路径以创建测试报告。
我设置: MY_URL=mysite:myport REPORTPA=./mypath/mysecondfolder/ pytest -s testFile.py --html=REPORTPA/report.html
MY_URL=mysite:myport REPORTPA=./mypath/mysecondfolder/ pytest -s testFile.py --html=REPORTPA/report.html
我应该保存report.html,我尝试以下解决方案:
$REPORTPA/report.html or %REPORTPA/report.html
而且它用的不好。如何使用变量?
chr*_*ris 5
使用os.environ (docs),如下所示:
os.environ
>>> import os >>> reportpa = os.environ['REPORTPA'] >>> print(reportpa) ./mypath/mysecondfolder/
归档时间:
6 年,10 月 前
查看次数:
34 次
最近记录: