Unable to debug in pycharm with pytest

后端 未结 5 648
天命终不由人
天命终不由人 2021-02-01 00:56

I cannot debug in PyCharm using py.test. All the test suite is running ok in \"Debug mode\" but it doesn\'t stop on breakpoints.

I also have py

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 01:41

    For my situation, i found what the problem is:

    If there is --cov in pytest.ini, then breakpoints in pycharm won't work, after deleting all --cov in pytest.ini, the breakpoints in pycharm can work.

    Reason:

    "The coverage module and pycharm's debugger use the same tracing api (sys.settrace) - they don't work together. " -- https://github.com/pytest-dev/pytest-cov/issues/131

    References:

    How to debug py.test in PyCharm when coverage is enabled

提交回复
热议问题