How to run tests from PyCharm
Creating a configuration
To run the tests from PyCharm, a new configuration needs to be created. This is done in the following way:
In the bar at the top, press the current configuration next to the
Run
button to open a drop-downSelect
Edit Configurations...
In the topright, press the
+
button (the textAdd New Configuration
appears when hovering over the button)Scroll down until you find the tab called
Python tests
and selectpytest
under that tabFor
Script path
, select thetest
folderFor
Working directory
, select thetommy
folderSelect the correct python interpreter (make sure it is python 3.12 and that it is in your virtual environment)
(Optionally) give the configuration a name
Press
OK
Running the tests
Once the configuration is configured (pun not intended), simply select it from the dropdown next to the run button. Now press the run button and the test results should appear at the bottom of your screen.
Running PyTest normally
You can run PyTest from the command line, using the pytest.ini, by using the following commands:
cd ./tommy
pytest