【发布时间】:2019-04-25 22:14:46
【问题描述】:
使用 pytest 和 vscode-python,我想运行之前使用 unittest 框架实现的测试。
因此,我在相应目录 tests 中使用 pytest 成功运行了测试。
pytest
我还设置了 vscode-python 并成功测试了几乎所有的测试。
但是,那些从子目录 tests/data 加载数据的测试失败了,因为 vscode-python 似乎从另一个目录而不是测试目录 tests 运行 pytest。
abc/
|-- tests/
|-- test_function.py
|-- data/
如何设置 vscode-python,以便成功读取已经实现的测试中的所有数据文件?
【问题讨论】: