@@ -23,7 +23,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
23
23
cache.get(key, default)
24
24
cache.set(key, value)
25
25
26
- Keys must be a ``/`` separated value , where the first part is usually the
26
+ Keys must be ``/`` separated strings , where the first part is usually the
27
27
name of your plugin or application to avoid clashes with other cache users.
28
28
29
29
Values can be any object handled by the json stdlib module.
@@ -57,7 +57,8 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
57
57
``out`` and ``err`` will be ``byte`` objects.
58
58
59
59
doctest_namespace [session scope]
60
- Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests.
60
+ Fixture that returns a :py:class:`dict` that will be injected into the
61
+ namespace of doctests.
61
62
62
63
pytestconfig [session scope]
63
64
Session-scoped fixture that returns the :class:`_pytest.config.Config` object.
@@ -89,8 +90,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
89
90
automatically XML-encoded.
90
91
91
92
record_testsuite_property [session scope]
92
- Records a new ``<property>`` tag as child of the root ``<testsuite>``. This is suitable to
93
- writing global information regarding the entire test suite, and is compatible with ``xunit2`` JUnit family.
93
+ Record a new ``<property>`` tag as child of the root ``<testsuite>``.
94
+
95
+ This is suitable to writing global information regarding the entire test
96
+ suite, and is compatible with ``xunit2`` JUnit family.
94
97
95
98
This is a ``session``-scoped fixture which is called with ``(name, value)``. Example:
96
99
@@ -102,6 +105,12 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
102
105
103
106
``name`` must be a string, ``value`` will be converted to a string and properly xml-escaped.
104
107
108
+ .. warning::
109
+
110
+ Currently this fixture **does not work** with the
111
+ `pytest-xdist <https://github.com/pytest-dev/pytest-xdist>`__ plugin. See issue
112
+ `#7767 <https://github.com/pytest-dev/pytest/issues/7767>`__ for details.
113
+
105
114
caplog
106
115
Access and control log capturing.
107
116
@@ -114,8 +123,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
114
123
* caplog.clear() -> clear captured records and formatted log output string
115
124
116
125
monkeypatch
117
- The returned ``monkeypatch`` fixture provides these
118
- helper methods to modify objects, dictionaries or os.environ::
126
+ A convenient fixture for monkey-patching.
127
+
128
+ The fixture provides these methods to modify objects, dictionaries or
129
+ os.environ::
119
130
120
131
monkeypatch.setattr(obj, name, value, raising=True)
121
132
monkeypatch.delattr(obj, name, raising=True)
@@ -126,10 +137,9 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
126
137
monkeypatch.syspath_prepend(path)
127
138
monkeypatch.chdir(path)
128
139
129
- All modifications will be undone after the requesting
130
- test function or fixture has finished. The ``raising``
131
- parameter determines if a KeyError or AttributeError
132
- will be raised if the set/deletion operation has no target.
140
+ All modifications will be undone after the requesting test function or
141
+ fixture has finished. The ``raising`` parameter determines if a KeyError
142
+ or AttributeError will be raised if the set/deletion operation has no target.
133
143
134
144
recwarn
135
145
Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
@@ -140,30 +150,28 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
140
150
tmpdir_factory [session scope]
141
151
Return a :class:`_pytest.tmpdir.TempdirFactory` instance for the test session.
142
152
143
-
144
153
tmp_path_factory [session scope]
145
154
Return a :class:`_pytest.tmpdir.TempPathFactory` instance for the test session.
146
155
147
-
148
156
tmpdir
149
- Return a temporary directory path object
150
- which is unique to each test function invocation,
151
- created as a sub directory of the base temporary
152
- directory. The returned object is a `py.path.local`_
153
- path object.
157
+ Return a temporary directory path object which is unique to each test
158
+ function invocation, created as a sub directory of the base temporary
159
+ directory.
160
+
161
+ The returned object is a `py.path.local`_ path object.
154
162
155
163
.. _`py.path.local`: https://py.readthedocs.io/en/latest/path.html
156
164
157
165
tmp_path
158
- Return a temporary directory path object
159
- which is unique to each test function invocation,
160
- created as a sub directory of the base temporary
161
- directory. The returned object is a :class:`pathlib.Path`
162
- object.
166
+ Return a temporary directory path object which is unique to each test
167
+ function invocation, created as a sub directory of the base temporary
168
+ directory.
169
+
170
+ The returned object is a :class:`pathlib.Path` object.
163
171
164
172
.. note::
165
173
166
- in python < 3.6 this is a pathlib2.Path
174
+ In python < 3.6 this is a pathlib2.Path.
167
175
168
176
169
177
no tests ran in 0.12s
0 commit comments