【发布时间】:2021-11-10 11:54:55
【问题描述】:
在python模块integration_tests中,我有一个脚本可以通过文件run_tests.py中的pytest运行我的测试:
import pytest
if __name__ == "__main__":
pytest.main(['./integration_tests/']) # breakpoint here works, but no breakpoints in test methods
在我的docker-compose.yml 文件中,我附加了一个调试器并通过设置入口点来运行测试:
entrypoint: ["/usr/src/app/cvenv/bin/python3.8", "-m", "ptvsd", "--host", "0.0.0.0", "--port", "5678", "--wait", "./integration_tests/run_tests.py"]
run_tests.py 文件中的断点有效。但是之后没有断点被执行。
我如何才能真正调试测试,而不仅仅是在调用 pytest 之前?
【问题讨论】:
标签: python docker-compose pytest vscode-debugger