Skip to content

Commit

Permalink
Add note about not monkey-patching builtins (pytest-dev#1986)
Browse files Browse the repository at this point in the history
* Add note about not monkey-patching builtins

Related to pytest-dev#1985

* Mention -s as well
  • Loading branch information
nicoddemus authored and RonnyPfannschmidt committed Oct 5, 2016
1 parent d47ae79 commit 50b960c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/en/monkeypatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ will delete the method ``request.session.Session.request``
so that any attempts within tests to create http requests will fail.


.. note::

Be advised that it is not recommended to patch builtin functions such as ``open``,
``compile``, etc., because it might break pytest's internals. If that's
unavoidable, passing ``--tb=native``, ``--assert=plain`` and ``--capture=no`` might
help althought there's no guarantee.


Method reference of the monkeypatch fixture
-------------------------------------------

Expand Down

0 comments on commit 50b960c

Please sign in to comment.