File tree 2 files changed +23
-2
lines changed 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -943,7 +943,7 @@ a generic feature of the mark mechanism:
943
943
Note that the assigned variable *must * be called ``pytestmark ``, assigning e.g.
944
944
``foomark `` will not activate the fixtures.
945
945
946
- Lastly you can put fixtures required by all tests in your project
946
+ It is also possible to put fixtures required by all tests in your project
947
947
into an ini-file:
948
948
949
949
.. code-block :: ini
@@ -953,6 +953,22 @@ into an ini-file:
953
953
usefixtures = cleandir
954
954
955
955
956
+ .. warning ::
957
+
958
+ Note this mark has no effect in **fixture functions **. For example,
959
+ this **will not work as expected **:
960
+
961
+ .. code-block :: python
962
+
963
+ @pytest.mark.usefixtures (" my_other_fixture" )
964
+ @pytest.fixture
965
+ def my_fixture_that_sadly_wont_use_my_other_fixture ():
966
+ ...
967
+
968
+ Currently this will not generate any error or warning, but this is intended
969
+ to be handled by `#3664 <https://github.com/pytest-dev/pytest/issues/3664 >`_.
970
+
971
+
956
972
.. _`autouse` :
957
973
.. _`autouse fixtures` :
958
974
Original file line number Diff line number Diff line change @@ -170,9 +170,14 @@ pytest.mark.usefixtures
170
170
171
171
Mark a test function as using the given fixture names.
172
172
173
+ .. warning ::
174
+
175
+ This mark can be used with *test functions * only, having no affect when applied
176
+ to a **fixture ** function.
177
+
173
178
.. py :function :: pytest.mark.usefixtures(* names)
174
179
175
- :param args: the names of the fixture to use as strings
180
+ :param args: the names of the fixture to use, as strings
176
181
177
182
178
183
.. _`pytest.mark.xfail ref` :
You can’t perform that action at this time.
0 commit comments