File tree Expand file tree Collapse file tree 15 files changed +390
-359
lines changed Expand file tree Collapse file tree 15 files changed +390
-359
lines changed Original file line number Diff line number Diff line change @@ -24,18 +24,30 @@ How-to guides
24
24
:maxdepth: 2
25
25
26
26
how-to/usage
27
- how-to/existingtestsuite
28
27
how-to/assert
28
+ how-to/fixtures
29
29
how-to/mark
30
- how-to/monkeypatch
30
+ how-to/parametrize
31
31
how-to/tmpdir
32
- how-to/capture
32
+ how-to/monkeypatch
33
+ how-to/doctest
34
+ how-to/cache
35
+
36
+ how-to/logging
37
+ how-to/capture-stdout-stderr
38
+ how-to/capture-warnings
33
39
how-to/skipping
34
- how-to/parametrize
40
+
35
41
how-to/plugins
42
+ how-to/writing_plugins
43
+ how-to/writing_hook_functions
44
+
45
+ how-to/existingtestsuite
46
+ how-to/unittest
36
47
how-to/nose
48
+ how-to/xunit_setup
49
+
37
50
how-to/bash-completion
38
- how-to/fixtures
39
51
40
52
41
53
Reference guides
@@ -45,14 +57,7 @@ Reference guides
45
57
:maxdepth: 2
46
58
47
59
reference/fixtures
48
- reference/warnings
49
- reference/doctest
50
- reference/cache
51
- reference/unittest
52
- reference/xunit_setup
53
60
reference/plugin_list
54
- reference/writing_plugins
55
- reference/logging
56
61
reference/customize
57
62
reference/reference
58
63
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ About fixtures
6
6
.. seealso :: :ref:`how-to-fixtures`
7
7
.. seealso :: :ref:`Fixtures reference <reference-fixtures>`
8
8
9
+ pytest fixtures are designed to be explicit, modular and scalable.
9
10
10
11
What fixtures are
11
12
-----------------
Original file line number Diff line number Diff line change
1
+ .. _`assert` :
1
2
2
3
How to write and report assertions in tests
3
4
==================================================
4
5
5
- .. _`assertfeedback` :
6
6
.. _`assert with the assert statement` :
7
- .. _`assert` :
8
-
9
7
10
8
Asserting with the ``assert `` statement
11
9
---------------------------------------------------------
12
10
13
- ``pytest `` allows you to use the standard python ``assert `` for verifying
11
+ ``pytest `` allows you to use the standard Python ``assert `` for verifying
14
12
expectations and values in Python tests. For example, you can write the
15
13
following:
16
14
Original file line number Diff line number Diff line change 2
2
.. _cache :
3
3
4
4
5
- Cache: working with cross-testrun state
6
- =======================================
5
+ How to re-run failed tests and maintain state between test runs
6
+ ===============================================================
7
7
8
8
9
9
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
.. _`warnings` :
2
2
3
- Warnings Capture
4
- ================
3
+ How to capture warnings
4
+ =======================
5
5
6
6
7
7
Original file line number Diff line number Diff line change 1
1
.. _doctest :
2
2
3
- Doctest integration for modules and test files
3
+ How to run doctests
4
4
=========================================================
5
5
6
6
By default, all files matching the ``test*.txt `` pattern will
Original file line number Diff line number Diff line change 3
3
How-to guides
4
4
================
5
5
6
+ Core pytest functionality
7
+ -------------------------
8
+
6
9
.. toctree ::
7
10
:maxdepth: 1
8
11
9
12
usage
10
- existingtestsuite
11
13
assert
14
+ fixtures
12
15
mark
13
- monkeypatch
16
+ parametrize
14
17
tmpdir
15
- capture
18
+ monkeypatch
19
+ doctest
20
+ cache
21
+
22
+ test output and outcomes
23
+ ----------------------------
24
+
25
+ .. toctree ::
26
+ :maxdepth: 1
27
+
28
+ logging
29
+ capture-stdout-stderr
30
+ capture-warnings
16
31
skipping
17
- parametrize
32
+
33
+ Plugins
34
+ ----------------------------
35
+
36
+ .. toctree ::
37
+ :maxdepth: 1
38
+
18
39
plugins
40
+ writing_plugins
41
+ writing_hook_functions
42
+
43
+ pytest and other test systems
44
+ -----------------------------
45
+
46
+ .. toctree ::
47
+ :maxdepth: 1
48
+
49
+ existingtestsuite
50
+ unittest
19
51
nose
52
+ xunit_setup
53
+
54
+ pytest development environment
55
+ ------------------------------
56
+
57
+ .. toctree ::
58
+ :maxdepth: 1
59
+
20
60
bash-completion
21
- fixtures
61
+
62
+
Original file line number Diff line number Diff line change 1
1
.. _logging :
2
2
3
- Logging
4
- -------
5
-
6
-
7
-
3
+ How to manage logging
4
+ ---------------------
8
5
9
6
pytest captures log messages of level ``WARNING `` or above automatically and displays them in their own section
10
7
for each failed test in the same manner as captured stdout and stderr.
Original file line number Diff line number Diff line change 2
2
.. _`unittest.TestCase` :
3
3
.. _`unittest` :
4
4
5
- unittest.TestCase Support
6
- =========================
5
+ How to use `` unittest ``-based tests with pytest
6
+ ===============================================
7
7
8
8
``pytest `` supports running Python ``unittest ``-based tests out of the box.
9
9
It's meant for leveraging existing ``unittest ``-based test suites
You can’t perform that action at this time.
0 commit comments