How do I configure PyCharm to run py.test tests?

前端 未结 12 1336
闹比i
闹比i 2020-12-07 09:31

I want to start writing unit tests for my Python code, and the py.test framework sounds like a better bet than Python\'s bundled unittest. So I added a \"tests\" directory t

12条回答
  •  失恋的感觉
    2020-12-07 10:04

    In pycharm 2019.2, you can simply do this to run all tests:

    1. Run > Edit Configurations > Add pytest
    2. Set options as shown in following screenshot
    3. Click on Debug (or run pytest using e.g. hotkeys Shift+Alt+F9)

    For a higher integration of pytest into pycharm, see https://www.jetbrains.com/help/pycharm/pytest.html

提交回复
热议问题