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

前端 未结 12 1348
闹比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:12

    PyCharm 2017.3

    1. Preference -> Tools -> Python integrated Tools - Choose py.test as Default test runner.
    2. If you use Django Preference -> Languages&Frameworks -> Django - Set tick on Do not use Django Test runner
    3. Clear all previously existing test configurations from Run/Debug configuration, otherwise tests will be run with those older configurations.
    4. To set some default additional arguments update py.test default configuration. Run/Debug Configuration -> Defaults -> Python tests -> py.test -> Additional Arguments

提交回复
热议问题