Sangjun 개발 블로그
    • 태그
    • algorithm
    • apple
    • aws
    • boto3
    • cron
    • crontab
    • db
    • django
    • docker
    • facebook
    • fcm
    • go
    • google
    • gopacket
    • gui
    • kakao
    • learning
    • leetcode
    • library
    • linux
    • logging
    • mariadb
    • models
    • mssql
    • naver
    • nfs
    • numpy
    • oauth
    • opencv
    • postgredb
    • pytest
    • python
    • sniff
    • sql
    • swagger
    • windows
    • windows10
    • wsl
    Hero Image
    [python] 테스트 프레임워크 pytest 사용법

    1. 개요 및 설정 pytest는 에러 없는 좋은 코드를 개발만들기 위한 목적으로 개발된 Python 테스트 프레임워크이다. pytest 특징 다른 testing 라이브러리에 비해 사용법이 간단하다. 테스트를 병렬로 실행할 수 있다. 특정 테스트를 스킵할 수 있다. 다양한 서드 파트 라이브러리들이 있다. 설치 pip install -U pytest 2. 기본 사용법 2.1. 기본 테스트 test_sample.py # 테스트 대상 기능 def inc(x): return x + 1 # 테스트 실행 함수 def test_answer1(): assert inc(3) == 5 def test_answer2(): assert inc(3) == 4 pytest 실행 결과

    February 8, 2022 Read
    바로가기
    • About
    • Recent Posts
    Contact me:
    • sangjuncha.dev@gmail.com

    Toha Theme Logo Toha
    Copyright 2020. SangjunCha all rights reserved.
    Powered by Hugo Logo