Merge pull request #982 from codewarrior0/patch-1
Add notes to docstring of `monkeypatch.undo()`
This commit is contained in:
		
						commit
						06a70b6d6d
					
				|  | @ -191,7 +191,17 @@ class monkeypatch: | ||||||
|     def undo(self): |     def undo(self): | ||||||
|         """ Undo previous changes.  This call consumes the |         """ Undo previous changes.  This call consumes the | ||||||
|         undo stack. Calling it a second time has no effect unless |         undo stack. Calling it a second time has no effect unless | ||||||
|         you do more monkeypatching after the undo call.""" |         you do more monkeypatching after the undo call. | ||||||
|  |          | ||||||
|  |         There is generally no need to call `undo()`, since it is  | ||||||
|  |         called automatically during tear-down. | ||||||
|  |          | ||||||
|  |         Note that the same `monkeypatch` fixture is used across a | ||||||
|  |         single test function invocation. If `monkeypatch` is used both by | ||||||
|  |         the test function itself and one of the test fixtures,  | ||||||
|  |         calling `undo()` will undo all of the changes made in | ||||||
|  |         both functions. | ||||||
|  |         """ | ||||||
|         for obj, name, value in self._setattr: |         for obj, name, value in self._setattr: | ||||||
|             if value is not notset: |             if value is not notset: | ||||||
|                 setattr(obj, name, value) |                 setattr(obj, name, value) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue