Pytest
- Lets create a new virtual environment with pytest
- Create a new folder and cd into it
uv init .
uv add pytest
code .
- select python interpreter (ctrl + shift + p) and select current interpreter
-
Create a new file called as
test_main.py -
Prompt
You are a python expert
I have started learning how to write unittests with pytest
Give me all the pytest conventions
- Refer Here for the changes done to create a simple project and write basic tests
- Exercise: Ensure you create a simple function and test it
- Configure pytest in vscode.
