top of page

Misc 1: Pytest

  • Writer: Rhash Algo
    Rhash Algo
  • Oct 13, 2022
  • 1 min read

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 ============================================================

Recent Posts

See All
Module 2: Beginning Python Basics

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

 
 
 

Yorumlar


bottom of page