top of page
Writer's pictureRhash Algo

Misc 1: Pytest

Installation:

pip install -U pytest

Pytest Version:

$ pytest --version pytest 7.1.1


First Test

File Name: test_first.py

def samp(x): return x + 5 def test_samp(): assert samp(4) == 9


$ python3 -m pytest test_first.py 
========================================================== test session starts ===========================================================
platform darwin -- Python 3.10.6, pytest-7.1.3, pluggy-1.0.0
rootdir: /Users/rpaleru/Downloads/pytest
collected 1 item                                                                                                                         

test_first.py .                                                                                                                    [100%]

=========================================================== 1 passed in 0.00s ============================================================

1 view0 comments

Recent Posts

See All

Module 1: An introduction to Python

What can Python do? Build websites and software Automate routine tasks Data Analysis Game Development Why Python? General Purpose...

Module 2: Beginning Python Basics

The Print Statement Comments Python Data Structures String Operations Simple Input & Output Simple Output formatting Operators in Python

Comments


bottom of page