IntelliJ IDEA pytest No tests were found

Answered

I recently updated IntelliJ to the latest version 4 days ago and now whenever I run any python tests, the left test panel does not show any collected tests, but tests are running fine. I'm trying to get this functionality back. Here are my logs.

The right panel looks like this

/Users/hien/.virtualenvs/fox/bin/python3 "/Users/hien/Library/Application Support/IntelliJIdea2017.1/python/helpers/pycharm/_jb_pytest_runner.py" --target app/tests/web/controllers/user/user_controller_test.py::test_reset_password_user_not_found -- -s
Testing started at 3:36 PM ...
Launching py.test with arguments -s app/tests/web/controllers/user/user_controller_test.py::test_reset_password_user_not_found in /Users/hien/git/app
============================= test session starts ==============================
platform darwin -- Python 3.6.1, pytest-2.9.0, py-1.4.33, pluggy-0.3.1 -- /Users/hien/.virtualenvs/fox/bin/python3
cachedir: .cache
rootdir: /Users/hien/git/app, inifile: pytest.ini
plugins: xdist-1.14, subtesthack-0.1.1, mock-0.11.0, cov-2.2.1, hypothesis-3.1.0
collecting ... collected 38 items
app/tests/web/controllers/user/user_controller_test.py::test_reset_password_user_not_found ##teamcity[testSuiteStarted timestamp='2017-06-09T15:36:31.749' locationHint='python</Users/hien/git/app>://app' name='app' nodeId='1' parentNodeId='0']PASSED##teamcity[testFinished timestamp='2017-06-09T15:36:33.444' duration='175' locationHint='python</Users/hien/git/app>://app.tests.web.controllers.user.user_controller_test.test_reset_password_user_not_found' name='test_reset_password_user_not_found' nodeId='7' parentNodeId='6']
[INFO/MainProcess] process shutting down
[INFO] [util.py:info:54] [MainProcess:67759] [140736154383296:Dummy-1] process shutting down
[DEBUG/MainProcess] running all "atexit" finalizers with priority >= 0
[DEBUG] [util.py:debug:50] [MainProcess:67759] [140736154383296:Dummy-1] running all "atexit" finalizers with priority >= 0
[DEBUG/MainProcess] running the remaining "atexit" finalizers
[DEBUG] [util.py:debug:50] [MainProcess:67759] [140736154383296:Dummy-1] running the remaining "atexit" finalizers


=========================== 1 passed in 3.00 seconds ===========================
Process finished with exit code 0
Empty test suite.

17 comments

Hi Hmvien! I'm very sorry for the inconvenience! Unfortunately there is a problem with pytest and 2017.1.4 Plugin: PY-24606. Please downgrade plugin manually to the previous version (2017.1.171.4249.63): https://plugins.jetbrains.com/plugin/631-python or update to the IDEA 2017.2 EAP. New Plugin version for 2017.1.4 with the fix is planned to be released on the next week.

0

I'm still seeing this issue - any further word on when the fix will be out?

 

0

Hi Martin! Next plugin build for 2017.1.x version should include the fix. I'll check the ETA and return to you. Sorry for waiting!

0

Martin, new plugin version is planned on next week alongside with 2017.1.5 PyCharm release.

0

Unfortunately it was delayed. Hope we'll manage to land it on this week. I am sorry for the inconvenience!

0

Martin, 171.4694.71 was released - please give it a try. Sorry once again about the issue!

0

Works great - thank you!

 

I also see 2017.2 is out now :)

0

I just upgraded to 2017.2.1 and this problem is still here. This was working back in the version I had 2016.3 so kind of frustrating. Had I known in advanced I would never have upgraded.

I reinstalled version 2017.2.1 and this time choosing to clear the cache etc from previous version. This error appears (and I guess this might be a new error not related to this thread?):

in  File "C:\Program Files\JetBrains\PyCharm 2017.2.1\helpers\pycharm\_jb_unittest_runner.py", line 35  in <module>
main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING)
TypeError: __init__() got an unexpected keyword argument 'buffer'

 

UPDATE: Gave up. Went back to PyCharm 2016.3 where the test runner works out of the box.

 

 

0

Tobias, yes this error is unrelated to this thread and i don't remember I ever saw it. It's hard to tell what exactly went wrong, if you can create a ticket in our bug tracker providing more details about your project structure, interpreter used, installed packages and broken test run configuration it would help a lot.

0

Ok. will do. But it will have to wait a couple of days, I'm afraid. I have a deadline that I need to finish first. But then I can then also try the installation on a separate clean slate machine to see if I get the same problem there. I would guess this issue arises due to the previous installation of 2016.3 not being cleaned out put properly or something else installed on my workstation that screws things up.

0

Are there any news on that topic ? I have a similar Problem when running my unittests.

The Unittest window shows: No tests were found an i get the following traceback information:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.1\helpers\pycharm\_jb_unittest_runner.py", line 35, in <module>
    main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING)
TypeError: __init__() got an unexpected keyword argument 'buffer'

Project Interpreter Python 2.6.6.

Upgraded from 2016 Version some days ago. In this version everything worked fine for me.

 

0

Unfortunately, it seems it does not work. Tried PyCharm 2017.3.1, 2017.2.3 (Community Edition). Even though I'm choosing py.test in integration tools, IDE runs as it it was unittest.

Launching unittests with arguments python -m unittest discover -s

and of course it does not find any tests as described earlier. Could you double check that your fix works?

0

Hi Piotr! Please make sure there's no existed unittest run configuration for the test file/folder. It there's one - PyCharm is going to execute it instead of creating a new one with pytest. If this is not the case - please create a ticket in our bug tracker and we'll investigate the problem further. Thank you!

0

Please sign in to leave a comment.