繁体   English   中英

Azure管道中的Pytest没有看到具体文件?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM