I'm having issues with running pytest tests from inside PyCharm
I have a file x_tests.py inside a folder called agents_automation_2 in C:\Temp, the content of the file is
import pytest
def test_mytest():
assert False
When I run I get the following output
C:\Python36-32\python.exe "C:\Program Files\JetBrains\PyCharm 2017.3.2\helpers\pycharm_jb_pytest_runner.py" --path C:/Temp/agents_automation_2 Launching py.test with arguments C:/Temp/agents_automation_2 in C:\Temp\agents_automation_2 ============================= test session starts ============================= platform win32 -- Python 3.6.4, pytest-3.4.2, py-1.5.2, pluggy-0.6.0 rootdir: C:\Temp\agents_automation_2, inifile: plugins: xdist-1.22.0, forked-0.2 collected 0 items ======================== no tests ran in 0.01 seconds =========================
However, when I run from a regular windows command line inside the folder the test runs OK
Any idea of what might be the issue ?
Thanks !!!
To determine why tests are not running, these steps are useful: Verify that all files with test cases start with 'test_' word. Verify that all test cases names also start with 'test_' word. Verify that you have created pytest.
PyCharm makes it easy to select just one test to run. In fact, there are several ways to do it: With the cursor anywhere in the test you want to focus on, right-click and choose to run that in the test runner. Right-click on the test in the test tool listing and choose to run it.
In my case, test class contains init method, cause empty suite as well. What you need to do is to avoid to write init method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With