Skip to content

Remove example of "monkeypatch" used in session scope #1876

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions doc/en/monkeypatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,6 @@ This autouse fixture will be executed for each test function and it
will delete the method ``request.session.Session.request``
so that any attempts within tests to create http requests will fail.

example: setting an environment variable for the test session
-------------------------------------------------------------

If you would like for an environment variable to be
configured for the entire test session, you can add this to your
top-level ``conftest.py`` file:

.. code-block:: python

# content of conftest.py
@pytest.fixture(scope='session', autouse=True)
def enable_debugging(monkeypatch):
monkeypatch.setenv("DEBUGGING_VERBOSITY", "4")

This auto-use fixture will set the ``DEBUGGING_VERBOSITY`` environment variable for
the entire test session.

Note that the ability to use a ``monkeypatch`` fixture from a ``session``-scoped
fixture was added in pytest-3.0.


Method reference of the monkeypatch fixture
-------------------------------------------
Expand Down