Skip to content

Commit 7e00362

Browse files
authored
Add note about not monkey-patching builtins
Related to #1985
1 parent fc02003 commit 7e00362

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/en/monkeypatch.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ will delete the method ``request.session.Session.request``
5555
so that any attempts within tests to create http requests will fail.
5656

5757

58+
.. note::
59+
60+
Be advised that it is not recommended to patch builtin functions such as ``open``,
61+
``compile``, etc., because it might break pytest's internals. If that's
62+
unavoidable, passing ``--tb=native`` and/or ``--assert=plain`` might help althought
63+
there's no guarantee.
64+
65+
5866
Method reference of the monkeypatch fixture
5967
-------------------------------------------
6068

0 commit comments

Comments
 (0)