Python Classroom notes 30/Apr/2026

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.

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading