From 637f35b4a6dfb231c751d9b41f09babdd79a627a Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 19 May 2009 20:00:24 +0200 Subject: [PATCH] nicer docstring for monkeypatch funcarg plugin --HG-- branch : trunk --- py/test/plugin/pytest_monkeypatch.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/py/test/plugin/pytest_monkeypatch.py b/py/test/plugin/pytest_monkeypatch.py index 25684632e..943c6443a 100644 --- a/py/test/plugin/pytest_monkeypatch.py +++ b/py/test/plugin/pytest_monkeypatch.py @@ -1,4 +1,17 @@ import os +""" + provides the "monkeypatch" funcarg for safely patching objects, + dictionaries and environment variables during the execution of + a test. There are three helper functions: + + monkeypatch.setattr(obj, name, value) + monkeypatch.setitem(obj, name, value) + monkeypatch.setenv(name, value) + + After the test run all such modifications will be undone, + which may even mean deleting the attribute or dictionary entry + if it didn't exist before. +""" def pytest_funcarg__monkeypatch(request): monkeypatch = MonkeyPatch()