File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,23 @@ def tearDownClass(cls):
111111
112112
113113def cleanup (style = None ):
114+ """
115+ A decorator to ensure that any global state is reset before
116+ running a test.
117+
118+ Parameters
119+ ----------
120+ style : str, optional
121+ The name of the style to apply.
122+ """
123+
124+ # If cleanup is used without arguments, `style` will be a
125+ # callable, and we pass it directly to the wrapper generator. If
126+ # cleanup if called with an argument, it is a string naming a
127+ # style, and the function will be passed as an argument to what we
128+ # return. This is a confusing, but somewhat standard, pattern for
129+ # writing a decorator with optional arguments.
130+
114131 def make_cleanup (func ):
115132 @functools .wraps (func )
116133 def wrapped_function (* args , ** kwargs ):
You can’t perform that action at this time.
0 commit comments