From 56ec0c671605d38a5d799a99ba0e4c3511123b2a Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 17 Feb 2016 23:59:13 -0800 Subject: [PATCH] Make @cleanup *really* support generative tests. --- lib/matplotlib/testing/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/testing/decorators.py b/lib/matplotlib/testing/decorators.py index f4318569009c..f61b13194700 100644 --- a/lib/matplotlib/testing/decorators.py +++ b/lib/matplotlib/testing/decorators.py @@ -130,7 +130,7 @@ def cleanup(style=None): # writing a decorator with optional arguments. def make_cleanup(func): - if inspect.isgenerator(func): + if inspect.isgeneratorfunction(func): @functools.wraps(func) def wrapped_callable(*args, **kwargs): original_units_registry = matplotlib.units.registry.copy()