【发布时间】:2023-01-08 02:54:10
【问题描述】:
我有一个标准的项目设置,其中我的 test.py 在应用程序文件夹中。
像这样:
django_project/my_app/tests.py
当我手动运行
py manage.py test
它识别我的测试文件。
使用此调试配置时,它不会运行测试。
Found 0 test(s).
System check identified no issues (0 silenced).
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
我怎样才能正确设置它们?
启动.json:
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}\\django_project\\manage.py",
"args": [
"test"
],
"django": true,
"justMyCode": true
},
【问题讨论】:
-
配置中 manage.py 的路径是正确的。 “${workspaceFolder}\\django_project\\manage.py” 我在“args”下使用“runserver”而不是“test”运行这个配置并且它有效。所以它一定是不同的东西。有任何想法吗?
标签: python django visual-studio-code django-testing