Py.test tests fail in Pycharm 2017.1 due to current directory
Just installed a new version of Pycharm 2017.1 and all my py.test test cases have stopped working. Dug a little bit and it looks like previous versions of Pycharm were used to run test cases from the project directory Test
. Pycharm now seems to run tests from the project directory Root
- hence test detection is not working as expected.
Others have identified the same problem but there are no solutions yet.
I tried to manually set the Working Directory to Edit Configurations
, but it didn't work. Anyone have a suggestion to fix this issue?
Note that I used to right click on the test case and only Pycharm
gave me the option to run one case. Now this parameter is no longer displayed. Perhaps it could be due to the detection of the test as I am getting the errorEmpty test suite.
ADDED
Error log for Pycharm. Note that the test is run from the package root instead of ../test directory
:
Testing started at 6:15 PM ...
Launching py.test with arguments
test_pyugend.py::test_bokeh_sweep_plot_overall
ERROR: file not found: test_pyugend.py::test_bokeh_sweep_plot_overall
============================= test session starts
==============================
platform linux -- Python 3.5.2, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir:
/media/krishnab/jaimini/development/gender_equity/
university_gender_dynamics/py_package_ugend, inifile:
========================= no tests ran in 0.00 seconds
=========================
Process finished with exit code 0
Empty test suite.
My version info Pycharm
:
PyCharm 2017.1
Build #PY-171.3780.115, built on March 24, 2017
Licensed to shrikrishna bhogaonker
Subscription is active until January 13, 2018
For educational use only.
JRE: 1.8.0_112-release-736-b13 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.4.0-59-generic
source to share
having the same situation. updated pycharm to version 2017.1.2.it works for me now.
PyCharm 2017.1.2 Build # PY-171.4249.47 JRE: 1.8.0_112-release-736-b21 x86_64 Mac OS X 10.11.4
https://confluence.jetbrains.com/display/PYH/PyCharm+171.4249.47+Release+Notes?fromIDE
source to share