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 func(x):
return x + 1
def test_answer():
assert func(3) == 5
To execute it:
$ pytest
======= test session starts ========
platform linux -- Python 3.4.3, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
collected 1 items
test_sample.py F
======= FAILURES ========
_______ test_answer ________
def test_answer():
> assert func(3) == 5
E assert 4 == 5
E + where 4 = func(3)
test_sample.py:5: AssertionError
======= 1 failed in 0.12 seconds ========
Due to py.test’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;
Python2.6+, Python3.3+, PyPy-2.3, Jython-2.5 (untested);
Rich plugin architecture, with over 150+ external plugins and thriving community;
Documentation
For full documentation, including installation, tutorials and PDF documents, please see http://docs.pytest.org.
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.
License
Copyright Holger Krekel and others, 2004-2016.
Distributed under the terms of the MIT license, pytest is free and open source software.
Metadata
Release files for pytest 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pytest-3.0.1.tar.gz | 731.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest-3.0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 900.9 kB
Release files / pytest-3.0.1.tar.gz
| Download URL | pytest-3.0.1.tar.gz |
|---|---|
| Size | 731.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e82bc0596ee96b2287c08705cfcb6898db1fe4b5c87db3b6823f1fdd77fb3ff1
|
|
BLAKE2b-256 checksum How to use checksums |
4860ac0e3482d1c57ace39b709c765b9e04f4478f38ab53be4dce4fa5e478f16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytest-3.0.1-py2.py3-none-any.whl
| Download URL | pytest-3.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 169.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ba6ae459222c3ee650d9e7a3f8cbf69c23c20ed6977496e9081f3b8da19107d0
|
|
BLAKE2b-256 checksum How to use checksums |
00b162d1da704e18603026245380b2407387b3ec7b0d3e3399c98933f2487d2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pytest 3.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.