Skip to content

Instantly share code, notes, and snippets.

@shresthakamal
Created May 29, 2021 09:34
Show Gist options
  • Save shresthakamal/16c573a3f46d2f7e425887b5c6e9589b to your computer and use it in GitHub Desktop.
Save shresthakamal/16c573a3f46d2f7e425887b5c6e9589b to your computer and use it in GitHub Desktop.
Pytest
""" Pytest Notes
Tests increases your confidence that the code behaves as you expect and ensures that changes to your code won’t cause regressions.
- Several short comming of unittest
- Need to import Test case class
- Define a function for each test cases
-
- With pytest common t tasks takes les code time saving commands for advanced tasks
- Arrange-Act_Assert Model
- Setup the condition for the test
- Act by calling some function or method
- Assert that some end condition is true
"""
# Installation:
python -m pip install pytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment