pytest-dev/pytest


The pytest framework makes it easy to write small tests, yet scales to support complex functional testing

https://pytest.org

License: MIT

Language: Python

Keywords: python, test, testing, unit-testing


pytest
Code coverage Status https://travis-ci.org/pytest-dev/pytest.svg?branch=master https://dev.azure.com/pytest-dev/pytest/_apis/build/status/pytest-CI?branchName=master

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries.

An example of a simple test:

# content of test_sample.py
def inc(x):
    return x + 1


def test_answer():
    assert inc(3) == 5

To execute it:

$ pytest
============================= test session starts =============================
collected 1 items

test_sample.py F

================================== FAILURES ===================================
_________________________________ test_answer _________________________________

    def test_answer():
>       assert inc(3) == 5
E       assert 4 == 5
E        +  where 4 = inc(3)

test_sample.py:5: AssertionError
========================== 1 failed in 0.04 seconds ===========================

Due to pytest's detailed assertion introspection, only plain assert statements are used. See getting-started for more examples.

Features

  • Detailed info on failing assert statements (no need to remember self.assert* names);
  • Auto-discovery of test modules and functions;
  • Modular fixtures for managing small or parametrized long-lived test resources;
  • Can run unittest (or trial), nose test suites out of the box;
  • Python 3.5+ and PyPy3;
  • Rich plugin architecture, with over 315+ external plugins and thriving community;

Documentation

For full documentation, including installation, tutorials and PDF documents, please see https://docs.pytest.org/en/latest/.

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

Changelog

Consult the Changelog page for fixes and enhancements of each version.

Support pytest

You can support pytest by obtaining a Tidelift subscription.

Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.

Security

pytest has never been associated with a security vunerability, but in any case, to report a security vulnerability please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

License

Copyright Holger Krekel and others, 2004-2019.

Distributed under the terms of the MIT license, pytest is free and open source software.

Project Statistics

Sourcerank 22
Repository Size 17.4 MB
Stars 4,592
Forks 1,103
Watchers 162
Open issues 561
Dependencies 4
Contributors 454
Tags 131
Created
Last updated
Last pushed

Top Contributors See all

Bruno Oliveira holger krekel Check your git settings! Ronny Pfannschmidt Daniel Hahler Anthony Sottile Benjamin Peterson Floris Bruynooghe Florian Bruhin Anatoly Bubenkov Thomas Hisch Raphael Pierzina Jeffrey Rackauckas Sup3rGeo Andras Tim Kale Kundert Oleg Jurko Gospodnetić Brianna Laugher Jason R. Coombs

Packages Referencing this Repo

pytest
pytest: simple powerful testing with Python
Latest release 5.1.2 - Updated - 4.59K stars

Recent Tags See all

5.1.2 August 30, 2019
5.1.1 August 20, 2019
5.1.0 August 16, 2019
4.6.5 August 05, 2019
5.0.1 July 05, 2019
4.6.4 June 29, 2019
5.0.0 June 28, 2019
4.6.3 June 11, 2019
4.6.2 June 03, 2019
4.6.1 June 02, 2019
4.6.0 June 01, 2019
4.5.0 May 11, 2019
4.4.2 May 08, 2019
4.4.1 April 15, 2019
4.4.0 March 29, 2019

Interesting Forks See all

hackebrot/pytest
The pytest testing tool makes it easy to write small tests, yet scales to support complex functio...
Python - MIT - Last pushed - 1 stars
ionelmc/pytest
The pytest testing tool makes it easy to write small tests, yet scales to support complex functio...
Python - MIT - Last pushed - 1 stars
Sup3rGeo/pytest
The pytest framework makes it easy to write small tests, yet scales to support complex functional...
Python - MIT - Last pushed - 1 stars
sebastinas/pytest
The pytest framework makes it easy to write small tests, yet scales to support complex functional...
Python - MIT - Last pushed - 1 stars - 1 forks
DATLegendKujo/pytest
The pytest framework makes it easy to write small tests, yet scales to support complex functional...
Python - Updated - 1 stars - 1 forks

Something wrong with this page? Make a suggestion

Last synced: 2019-08-05 18:06:25 UTC

Login to resync this repository