Skip to content

Glossary: Refactoring and Clean Code

monkeypatch

Also written: monkeypatch.setattr

A pytest fixture that replaces a name inside a module for one test, such as a fake `send_email`, and restores the original afterwards.

Where the book teaches it

Related terms

Seamfixture (pytest)dependency injection