![](/img/trans.png)
[英]Azure DevOps Pipeline does not run Pytest. Keeps loading
[英]Pytest in Azure pipeline does not see specific files?
我有一个src
目录,其中包含一个pyproject.toml
,就在我的setup.py
旁边(事实上,我可以找到它)。
但是当我运行任务时
- bash: pytest -c src/pyproject.toml
displayName: Run tests
workingDirectory: $(Pipeline.Workspace)
我得到FileNotFoundError: [Errno 2] No such file or directory: '/home/vsts/work/1/src/pyproject.toml'
。
一切正常,无需尝试从 pytest 指向此文件。 为什么? 相同的设置在本地运行良好。
workingDirectory
应该是$(System.DefaultWorkingDirectory)
,而不是$(Pipeline.Workspace)
。
$(Pipeline.Workspace)
是代理上创建给定构建管道的所有文件夹的本地路径。
$(System.DefaultWorkingDirectory)
是下载源代码文件的代理上的本地路径。
单击此文档以获取有关 Azure DevOps 中预定义变量的详细信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.