• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..11-Apr-2017-

.github/H11-Apr-2017-1812

_pytest/H11-Apr-2017-14,72411,814

bench/H11-Apr-2017-6139

doc/en/H11-Apr-2017-14,88810,428

extra/H11-Apr-2017-8769

testing/H11-Apr-2017-21,33818,401

.coveragercH A D11-Apr-2017227 87

.gitattributesH A D11-Apr-201725 21

.gitignoreH A D11-Apr-2017376 3530

.travis.ymlH A D11-Apr-2017908 4138

AUTHORSH A D11-Apr-20171.3 KiB8885

CHANGELOG.rstH A D11-Apr-2017101.6 KiB2,5871,884

CONTRIBUTING.rstH A D11-Apr-20178.6 KiB254164

HOWTORELEASE.rstH A D11-Apr-20172.5 KiB9356

LICENSEH A D11-Apr-20171.1 KiB2217

MANIFEST.inH A D11-Apr-2017511 3523

README.rstH A D11-Apr-20173.1 KiB10365

appveyor.ymlH A D11-Apr-20171 KiB2923

plugin-test.shH A D11-Apr-2017282 2113

pytest.pyH A D11-Apr-2017621 2920

runtox.pyH A D11-Apr-2017248 96

setup.cfgH A D11-Apr-2017197 1410

setup.pyH A D11-Apr-20174.4 KiB123102

tox.iniH A D11-Apr-20173.3 KiB161136

README.rst

1.. image:: http://pytest.org/latest/_static/pytest1.png
2   :target: http://pytest.org
3   :align: center
4   :alt: pytest
5
6------
7
8.. image:: https://img.shields.io/pypi/v/pytest.svg
9   :target: https://pypi.python.org/pypi/pytest
10.. image:: https://img.shields.io/pypi/pyversions/pytest.svg
11  :target: https://pypi.python.org/pypi/pytest
12.. image:: https://img.shields.io/coveralls/pytest-dev/pytest/master.svg
13   :target: https://coveralls.io/r/pytest-dev/pytest
14.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master
15    :target: https://travis-ci.org/pytest-dev/pytest
16.. image:: https://ci.appveyor.com/api/projects/status/mrgbjaua7t33pg6b?svg=true
17    :target: https://ci.appveyor.com/project/pytestbot/pytest
18
19The ``pytest`` framework makes it easy to write small tests, yet
20scales to support complex functional testing for applications and libraries.
21
22An example of a simple test:
23
24.. code-block:: python
25
26    # content of test_sample.py
27    def func(x):
28        return x + 1
29
30    def test_answer():
31        assert func(3) == 5
32
33
34To execute it::
35
36    $ py.test
37    ======= test session starts ========
38    platform linux -- Python 3.4.3, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
39    collected 1 items
40
41    test_sample.py F
42
43    ======= FAILURES ========
44    _______ test_answer ________
45
46        def test_answer():
47    >       assert func(3) == 5
48    E       assert 4 == 5
49    E        +  where 4 = func(3)
50
51    test_sample.py:5: AssertionError
52    ======= 1 failed in 0.12 seconds ========
53
54Due to ``py.test``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <http://pytest.org/latest/getting-started.html#our-first-test-run>`_ for more examples.
55
56
57Features
58--------
59
60- Detailed info on failing `assert statements <http://pytest.org/latest/assert.html>`_ (no need to remember ``self.assert*`` names);
61
62- `Auto-discovery
63  <http://pytest.org/latest/goodpractices.html#python-test-discovery>`_
64  of test modules and functions;
65
66- `Modular fixtures <http://pytest.org/latest/fixture.html>`_  for
67  managing small or parametrized long-lived test resources;
68
69- Can run `unittest <http://pytest.org/latest/unittest.html>`_ (or trial),
70  `nose <http://pytest.org/latest/nose.html>`_ test suites out of the box;
71
72- Python2.6+, Python3.2+, PyPy-2.3, Jython-2.5 (untested);
73
74- Rich plugin architecture, with over 150+ `external plugins <http://pytest.org/latest/plugins.html#installing-external-plugins-searching>`_ and thriving community;
75
76
77Documentation
78-------------
79
80For full documentation, including installation, tutorials and PDF documents, please see http://pytest.org.
81
82
83Bugs/Requests
84-------------
85
86Please use the `GitHub issue tracker <https://github.com/pytest-dev/pytest/issues>`_ to submit bugs or request features.
87
88
89Changelog
90---------
91
92Consult the `Changelog <http://pytest.org/latest/changelog.html>`_ page for fixes and enhancements of each version.
93
94
95License
96-------
97
98Copyright Holger Krekel and others, 2004-2016.
99
100Distributed under the terms of the `MIT`_ license, pytest is free and open source software.
101
102.. _`MIT`: https://github.com/pytest-dev/pytest/blob/master/LICENSE
103