更新时间:2021-12-14 00:47:22
有时这可能是由于其他模块使用相同的跟踪 API (sys.settrace
) 作为调试器,例如Coverage.py
.解决方案是转到您的 Rub/Debug Configurations 并将 --no-cov
标志添加到 Additional Arguments.
Sometimes this might be caused by the fact that some other module is using the same tracing api (sys.settrace
) as debugger, for instance Coverage.py
. The solution would be to go to your Rub/Debug Configurations and add --no-cov
flag to the Additional Arguments.
或者,您可能希望删除 pytest 设置(即 pytest.ini
)中的所有 --cov
或使用 --no-cov运行测试代码>标志,即
Alternatively you might want to delete all --cov
in pytest settings (i.e. pytest.ini
) or run tests with --no-cov
flag, i.e.
pytest test.py --no-cov
这也可能是由错误的文件名引起的,例如您的文件/目录中有特殊字符或空格.尝试删除它们或更改为例如下划线 (_
).
It might be also caused by a bad filename, e.g. your file/directory has special characters or spaces in it. Try removing them or changing to e.g. underscore (_
).