| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -908,7 +908,7 @@ def close(fig=None): | |||
| 908 | 908 | _pylab_helpers.Gcf.destroy_fig(fig) | |
| 909 | 909 | else: | |
| 910 | 910 | raise TypeError("close() argument must be a Figure, an int, a string, " | |
| 911 | - "or None, not '%s'") | ||
| 911 | + "or None, not %s" % type(fig)) | ||
| 912 | 912 | ||
| 913 | 913 | ||
| 914 | 914 | def clf(): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -153,3 +153,11 @@ def test_nested_ion_ioff(): | |||
| 153 | 153 | with plt.ioff(): | |
| 154 | 154 | plt.ion() | |
| 155 | 155 | assert not mpl.is_interactive() | |
| 156 | + | ||
| 157 | + | ||
| 158 | + def test_close(): | ||
| 159 | + try: | ||
| 160 | + plt.close(1.1) | ||
| 161 | + except TypeError as e: | ||
| 162 | + assert str(e) == "close() argument must be a Figure, an int, " \ | ||
| 163 | + "a string, or None, not <class 'float'>" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments