-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New doc role: globalvar for special variables #7474
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
Added support for ``NO_COLOR`` and ``FORCE_COLOR`` environment variables to control colored output. | ||
|
||
For more information, see `the docs <https://docs.pytest.org/en/stable/reference.html#environment-variables>`__. | ||
Added support for :envvar:`NO_COLOR` and :envvar:`FORCE_COLOR` environment variables to control colored output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -900,14 +900,14 @@ Result used within :ref:`hook wrappers <hookwrapper>`. | |
.. automethod:: pluggy.callers._Result.get_result | ||
.. automethod:: pluggy.callers._Result.force_result | ||
|
||
Special Variables | ||
----------------- | ||
Global Variables | ||
---------------- | ||
|
||
pytest treats some global variables in a special manner when defined in a test module. | ||
pytest treats some global variables in a special manner when defined in a test module or | ||
``conftest.py`` files. | ||
|
||
|
||
collect_ignore | ||
~~~~~~~~~~~~~~ | ||
.. globalvar:: collect_ignore | ||
|
||
**Tutorial**: :ref:`customizing-test-collection` | ||
|
||
|
@@ -919,8 +919,7 @@ Needs to be ``list[str]``. | |
collect_ignore = ["setup.py"] | ||
collect_ignore_glob | ||
~~~~~~~~~~~~~~~~~~~ | ||
.. globalvar:: collect_ignore_glob | ||
|
||
**Tutorial**: :ref:`customizing-test-collection` | ||
|
||
|
@@ -933,8 +932,7 @@ contain glob patterns. | |
collect_ignore_glob = ["*_ignore.py"] | ||
pytest_plugins | ||
~~~~~~~~~~~~~~ | ||
.. globalvar:: pytest_plugins | ||
|
||
**Tutorial**: :ref:`available installable plugins` | ||
|
||
|
@@ -950,13 +948,12 @@ Can be either a ``str`` or ``Sequence[str]``. | |
pytest_plugins = ("myapp.testsupport.tools", "myapp.testsupport.regression") | ||
pytestmark | ||
~~~~~~~~~~ | ||
.. globalvar:: pytestmark | ||
|
||
**Tutorial**: :ref:`scoped-marking` | ||
|
||
Can be declared at the **global** level in *test modules* to apply one or more :ref:`marks <marks ref>` to all | ||
test functions and methods. Can be either a single mark or a list of marks. | ||
test functions and methods. Can be either a single mark or a list of marks (applied in left-to-right order). | ||
|
||
.. code-block:: python | ||
|
@@ -971,12 +968,6 @@ test functions and methods. Can be either a single mark or a list of marks. | |
pytestmark = [pytest.mark.integration, pytest.mark.slow] | ||
PYTEST_DONT_REWRITE (module docstring) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not really a global variable, and is already mentioned in detail in the |
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The text ``PYTEST_DONT_REWRITE`` can be add to any **module docstring** to disable | ||
:ref:`assertion rewriting <assert introspection>` for that module. | ||
|
||
Environment Variables | ||
--------------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this legacy note to the bottom, the text reads better this way.