3

I can not run Django Python pytest under PyCharm
After I got the answer from the above URL. I am now trying to fully utilize my IDE functions as much as I can.
Here is another project in my company that using Django UnitTest. This is the command line I used.

$ python manage.py test --settings=eneos.config.settings.local

Actually --settings=eneos.config.settings.local is not required, because I put that config in the wsgi.py already. But explicit is better than implicit when I ask the question.

enter image description here

Unfortunately. It is not simple like pytest. I must miss some points in here.

First several lines in the window.

/Users/el/.pyenv/versions/eneos-pos-web/bin/python "/Users/el/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/171.4694.38/PyCharm.app/Contents/helpers/pycharm/_jb_unittest_runner.py" --path .
Testing started at 2:17 PM ...
Launching unittests with arguments python -m unittest discover -s . -t /Users/el/Code/eneos-pos-web in /Users/el/Code/eneos-pos-web
Error
Traceback (most recent call last):

enter image description here

Update: enter image description here It used to ask me with Exclamation mark and let me fix the path in the bottom right. Just put working directory and configuration file in the asking form.

enter image description here Done!

1
  • There's a Django test run configuration. Commented Jul 2, 2017 at 7:27

1 Answer 1

1

There is a Django tests run configuration.

Django tests

Using that, you can set Django-specific options; Custom settings, for example.

Sign up to request clarification or add additional context in comments.

4 Comments

Holy Sh.t. I was reading on this docs.djangoproject.com/en/1.11/topics/testing/overview and it direct me to unittest!. Hold on one moment. I will get back to forum
But that is only for professional edition tho
@swdev,Yes, only professional edition support python web frameworks. jetbrains.com/pycharm/features/editions_comparison_matrix.html
@falsetru for now I think I am quite satisfied with pytest-django in pycharm community. no click on error source code level, but good enough. At least there is an UI for that

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.