gCoh
gCoh

Reputation: 3089

PyCharm run django single test as part of class

When running single test in PyCharm (django), the IDE create new config with target

boo.bar.tests.TestClass.test_whatwver 

This will not run the test, as the class is considered to be a method

when running

boo.bar.tests:TestClass.test_whatwver 

(with colon between tests:TestClass test will be executed

is there a way telling PyCharm doing it by default?

Upvotes: 2

Views: 147

Answers (2)

gCoh
gCoh

Reputation: 3089

the problem is that pycharm won't recognise custom settings.py (called it test_settings.py), so it needs to be configured manually

go to Preferences | Languages & Frameworks | Django and set Settings file path to your local settings.py

Upvotes: 1

gCoh
gCoh

Reputation: 3089

This is happening regardless to PyCharm, NoseTest is looking for : delimiter between filename and class

If you run with different test suit, it will run

In general, PyCharm is running a test helper for running tests

https://github.com/JetBrains/intellij-community/blob/master/python/helpers/pycharm/django_test_manage.py

If you override its default values (changing TEST_RUNNER value for instance), you might experience problems

Upvotes: 1

Related Questions