Default test runner not respected?
Answered
I have selected 'py.test' as my default test runner under Tools > Python Integrated Tools in the settings. When right-clicking a directory in the source tree, I expect to see an item to run all tests in that directory using py.test. However, I only see an item named "Run: 'Test: name.of.my.module'" and a similar one for debug. When I click this option, it creates a temporary run configuration under Django tests instead of using py.test.
Is there anything else I need to check before I can run my tests with py.test? I remember this working on my computer at some point, but it's no longer giving me the right behavior. I'm on the new 2017.2 version and I've also experienced this on the 2017.1 version.
Please sign in to leave a comment.
Hello.
If you have Django integration enabled and one of your test cases extends ``TestCase`` from ``django`` package then Django test runner will be used regardless your settings.
You may create run configuration manually for any folder and test runner you need. There is an issue you may vote: https://youtrack.jetbrains.com/issue/PY-20521
To avoid using the Django test runner you just need to tick 'Do not use Django test runner' in settings:
Since posting this thread a few years ago, I did indeed find out that unchecking 'Do not use Django test runner' does the trick. So do as Pavelpricope says ;)