【发布时间】:2019-07-10 04:07:09
【问题描述】:
我正在使用 Visual Studio Enterprise 来获取单元测试的代码覆盖率。单元测试将打开一个 Python shell 并执行其他 Python 脚本,例如,在 Python shell 中运行 execfile("other_script.py")。
但是,VS 不知道这个外部 Python shell 以及在那里调用的任何函数,因此它不会对在这个外部 Python shell 中运行的函数或脚本进行任何代码覆盖。
是否可以让 Visual Studio 也覆盖外部 Python shell 中运行的函数?
我所说的 Python shell 是指在 Windows 上运行 Python.exe 时将打开的窗口。
【问题讨论】:
标签: python visual-studio unit-testing code-coverage