Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4886ea9

Browse files
committed
In unit/memleak, write to in-memory buffer instead of file.
(Avoids cluttering the source directory.)
1 parent 6336f2d commit 4886ea9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

unit/memleak.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import print_function
44

55
import gc
6+
from io import BytesIO
67

78
try:
89
import tracemalloc
@@ -110,7 +111,7 @@ def __call__(self):
110111
ax = fig.add_subplot(224)
111112
ax.pcolor(10 * np.random.rand(50, 50))
112113

113-
fig.savefig('tmp', dpi=75)
114+
fig.savefig(BytesIO(), dpi=75)
114115
plt.close(1)
115116

116117

0 commit comments

Comments
 (0)