• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

smythi93 / Tests4Py / 30040549735

23 Jul 2026 08:04PM UTC coverage: 23.663% (-21.5%) from 45.174%
30040549735

push

github

web-flow
Merge pull request #106 from smythi93/dev

Release 1.0.0 — complete benchmark coverage (328/328 reproducible bugs)

11882 of 64778 new or added lines in 1205 files covered. (18.34%)

46 existing lines in 14 files now uncovered.

18085 of 76426 relevant lines covered (23.66%)

0.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/tests4py/projects/resources/matplotlib/bug_1/unittests.py
NEW
1
import unittest
×
NEW
2
from io import BytesIO
×
NEW
3
import matplotlib
×
NEW
4
matplotlib.use('Agg')
×
NEW
5
import numpy as np
×
NEW
6
import matplotlib.pyplot as plt
×
NEW
7
from PIL import Image
×
8

NEW
9
class TestsFailing(unittest.TestCase):
×
10

NEW
11
    def test_diversity_1(self):
×
NEW
12
        fig = plt.figure(frameon=False, dpi=100, figsize=(14 / 100, 7 / 100))
×
NEW
13
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
14
        fig.add_axes(ax)
×
NEW
15
        ax.set_axis_off()
×
NEW
16
        ax.get_xaxis().set_visible(False)
×
NEW
17
        ax.get_yaxis().set_visible(False)
×
NEW
18
        data = np.arange(14 * 7).reshape(7, 14)
×
NEW
19
        ax.imshow(data)
×
NEW
20
        out = BytesIO()
×
NEW
21
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
22
        out.seek(0)
×
NEW
23
        im = np.asarray(Image.open(out))
×
NEW
24
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
25
        self.assertEqual(True, ok)
×
NEW
26
        plt.close(fig)
×
27

NEW
28
    def test_diversity_2(self):
×
NEW
29
        fig = plt.figure(frameon=False, dpi=100, figsize=(29 / 100, 7 / 100))
×
NEW
30
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
31
        fig.add_axes(ax)
×
NEW
32
        ax.set_axis_off()
×
NEW
33
        ax.get_xaxis().set_visible(False)
×
NEW
34
        ax.get_yaxis().set_visible(False)
×
NEW
35
        data = np.arange(29 * 7).reshape(7, 29)
×
NEW
36
        ax.imshow(data)
×
NEW
37
        out = BytesIO()
×
NEW
38
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
39
        out.seek(0)
×
NEW
40
        im = np.asarray(Image.open(out))
×
NEW
41
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
42
        self.assertEqual(True, ok)
×
NEW
43
        plt.close(fig)
×
44

NEW
45
    def test_diversity_3(self):
×
NEW
46
        fig = plt.figure(frameon=False, dpi=100, figsize=(25 / 100, 7 / 100))
×
NEW
47
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
48
        fig.add_axes(ax)
×
NEW
49
        ax.set_axis_off()
×
NEW
50
        ax.get_xaxis().set_visible(False)
×
NEW
51
        ax.get_yaxis().set_visible(False)
×
NEW
52
        data = np.arange(25 * 7).reshape(7, 25)
×
NEW
53
        ax.imshow(data)
×
NEW
54
        out = BytesIO()
×
NEW
55
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
56
        out.seek(0)
×
NEW
57
        im = np.asarray(Image.open(out))
×
NEW
58
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
59
        self.assertEqual(True, ok)
×
NEW
60
        plt.close(fig)
×
61

NEW
62
    def test_diversity_4(self):
×
NEW
63
        fig = plt.figure(frameon=False, dpi=100, figsize=(16 / 100, 7 / 100))
×
NEW
64
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
65
        fig.add_axes(ax)
×
NEW
66
        ax.set_axis_off()
×
NEW
67
        ax.get_xaxis().set_visible(False)
×
NEW
68
        ax.get_yaxis().set_visible(False)
×
NEW
69
        data = np.arange(16 * 7).reshape(7, 16)
×
NEW
70
        ax.imshow(data)
×
NEW
71
        out = BytesIO()
×
NEW
72
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
73
        out.seek(0)
×
NEW
74
        im = np.asarray(Image.open(out))
×
NEW
75
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
76
        self.assertEqual(True, ok)
×
NEW
77
        plt.close(fig)
×
78

NEW
79
    def test_diversity_5(self):
×
NEW
80
        fig = plt.figure(frameon=False, dpi=100, figsize=(30 / 100, 7 / 100))
×
NEW
81
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
82
        fig.add_axes(ax)
×
NEW
83
        ax.set_axis_off()
×
NEW
84
        ax.get_xaxis().set_visible(False)
×
NEW
85
        ax.get_yaxis().set_visible(False)
×
NEW
86
        data = np.arange(30 * 7).reshape(7, 30)
×
NEW
87
        ax.imshow(data)
×
NEW
88
        out = BytesIO()
×
NEW
89
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
90
        out.seek(0)
×
NEW
91
        im = np.asarray(Image.open(out))
×
NEW
92
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
93
        self.assertEqual(True, ok)
×
NEW
94
        plt.close(fig)
×
95

NEW
96
    def test_diversity_6(self):
×
NEW
97
        fig = plt.figure(frameon=False, dpi=100, figsize=(9 / 100, 7 / 100))
×
NEW
98
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
99
        fig.add_axes(ax)
×
NEW
100
        ax.set_axis_off()
×
NEW
101
        ax.get_xaxis().set_visible(False)
×
NEW
102
        ax.get_yaxis().set_visible(False)
×
NEW
103
        data = np.arange(9 * 7).reshape(7, 9)
×
NEW
104
        ax.imshow(data)
×
NEW
105
        out = BytesIO()
×
NEW
106
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
107
        out.seek(0)
×
NEW
108
        im = np.asarray(Image.open(out))
×
NEW
109
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
110
        self.assertEqual(True, ok)
×
NEW
111
        plt.close(fig)
×
112

NEW
113
    def test_diversity_7(self):
×
NEW
114
        fig = plt.figure(frameon=False, dpi=100, figsize=(21 / 100, 7 / 100))
×
NEW
115
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
116
        fig.add_axes(ax)
×
NEW
117
        ax.set_axis_off()
×
NEW
118
        ax.get_xaxis().set_visible(False)
×
NEW
119
        ax.get_yaxis().set_visible(False)
×
NEW
120
        data = np.arange(21 * 7).reshape(7, 21)
×
NEW
121
        ax.imshow(data)
×
NEW
122
        out = BytesIO()
×
NEW
123
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
124
        out.seek(0)
×
NEW
125
        im = np.asarray(Image.open(out))
×
NEW
126
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
127
        self.assertEqual(True, ok)
×
NEW
128
        plt.close(fig)
×
129

NEW
130
    def test_diversity_8(self):
×
NEW
131
        fig = plt.figure(frameon=False, dpi=100, figsize=(24 / 100, 7 / 100))
×
NEW
132
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
133
        fig.add_axes(ax)
×
NEW
134
        ax.set_axis_off()
×
NEW
135
        ax.get_xaxis().set_visible(False)
×
NEW
136
        ax.get_yaxis().set_visible(False)
×
NEW
137
        data = np.arange(24 * 7).reshape(7, 24)
×
NEW
138
        ax.imshow(data)
×
NEW
139
        out = BytesIO()
×
NEW
140
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
141
        out.seek(0)
×
NEW
142
        im = np.asarray(Image.open(out))
×
NEW
143
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
144
        self.assertEqual(True, ok)
×
NEW
145
        plt.close(fig)
×
146

NEW
147
    def test_diversity_9(self):
×
NEW
148
        fig = plt.figure(frameon=False, dpi=100, figsize=(15 / 100, 7 / 100))
×
NEW
149
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
150
        fig.add_axes(ax)
×
NEW
151
        ax.set_axis_off()
×
NEW
152
        ax.get_xaxis().set_visible(False)
×
NEW
153
        ax.get_yaxis().set_visible(False)
×
NEW
154
        data = np.arange(15 * 7).reshape(7, 15)
×
NEW
155
        ax.imshow(data)
×
NEW
156
        out = BytesIO()
×
NEW
157
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
158
        out.seek(0)
×
NEW
159
        im = np.asarray(Image.open(out))
×
NEW
160
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
161
        self.assertEqual(True, ok)
×
NEW
162
        plt.close(fig)
×
163

NEW
164
    def test_diversity_10(self):
×
NEW
165
        fig = plt.figure(frameon=False, dpi=100, figsize=(12 / 100, 7 / 100))
×
NEW
166
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
167
        fig.add_axes(ax)
×
NEW
168
        ax.set_axis_off()
×
NEW
169
        ax.get_xaxis().set_visible(False)
×
NEW
170
        ax.get_yaxis().set_visible(False)
×
NEW
171
        data = np.arange(12 * 7).reshape(7, 12)
×
NEW
172
        ax.imshow(data)
×
NEW
173
        out = BytesIO()
×
NEW
174
        fig.savefig(out, bbox_inches='tight', pad_inches=0)
×
NEW
175
        out.seek(0)
×
NEW
176
        im = np.asarray(Image.open(out))
×
NEW
177
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
178
        self.assertEqual(True, ok)
×
NEW
179
        plt.close(fig)
×
180

NEW
181
class TestsPassing(unittest.TestCase):
×
182

NEW
183
    def test_diversity_1(self):
×
NEW
184
        fig = plt.figure(frameon=False, dpi=100, figsize=(28 / 100, 16 / 100))
×
NEW
185
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
186
        fig.add_axes(ax)
×
NEW
187
        ax.set_axis_off()
×
NEW
188
        ax.get_xaxis().set_visible(False)
×
NEW
189
        ax.get_yaxis().set_visible(False)
×
NEW
190
        data = np.arange(28 * 16).reshape(16, 28)
×
NEW
191
        ax.imshow(data)
×
NEW
192
        out = BytesIO()
×
NEW
193
        fig.savefig(out)
×
NEW
194
        out.seek(0)
×
NEW
195
        im = np.asarray(Image.open(out))
×
NEW
196
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
197
        self.assertEqual(True, ok)
×
NEW
198
        plt.close(fig)
×
199

NEW
200
    def test_diversity_2(self):
×
NEW
201
        fig = plt.figure(frameon=False, dpi=100, figsize=(7 / 100, 7 / 100))
×
NEW
202
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
203
        fig.add_axes(ax)
×
NEW
204
        ax.set_axis_off()
×
NEW
205
        ax.get_xaxis().set_visible(False)
×
NEW
206
        ax.get_yaxis().set_visible(False)
×
NEW
207
        data = np.arange(7 * 7).reshape(7, 7)
×
NEW
208
        ax.imshow(data)
×
NEW
209
        out = BytesIO()
×
NEW
210
        fig.savefig(out)
×
NEW
211
        out.seek(0)
×
NEW
212
        im = np.asarray(Image.open(out))
×
NEW
213
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
214
        self.assertEqual(True, ok)
×
NEW
215
        plt.close(fig)
×
216

NEW
217
    def test_diversity_3(self):
×
NEW
218
        fig = plt.figure(frameon=False, dpi=150, figsize=(22 / 150, 16 / 150))
×
NEW
219
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
220
        fig.add_axes(ax)
×
NEW
221
        ax.set_axis_off()
×
NEW
222
        ax.get_xaxis().set_visible(False)
×
NEW
223
        ax.get_yaxis().set_visible(False)
×
NEW
224
        data = np.arange(22 * 16).reshape(16, 22)
×
NEW
225
        ax.imshow(data)
×
NEW
226
        out = BytesIO()
×
NEW
227
        fig.savefig(out)
×
NEW
228
        out.seek(0)
×
NEW
229
        im = np.asarray(Image.open(out))
×
NEW
230
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
231
        self.assertEqual(True, ok)
×
NEW
232
        plt.close(fig)
×
233

NEW
234
    def test_diversity_4(self):
×
NEW
235
        fig = plt.figure(frameon=False, dpi=80, figsize=(6 / 80, 19 / 80))
×
NEW
236
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
237
        fig.add_axes(ax)
×
NEW
238
        ax.set_axis_off()
×
NEW
239
        ax.get_xaxis().set_visible(False)
×
NEW
240
        ax.get_yaxis().set_visible(False)
×
NEW
241
        data = np.arange(6 * 19).reshape(19, 6)
×
NEW
242
        ax.imshow(data)
×
NEW
243
        out = BytesIO()
×
NEW
244
        fig.savefig(out)
×
NEW
245
        out.seek(0)
×
NEW
246
        im = np.asarray(Image.open(out))
×
NEW
247
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
248
        self.assertEqual(True, ok)
×
NEW
249
        plt.close(fig)
×
250

NEW
251
    def test_diversity_5(self):
×
NEW
252
        fig = plt.figure(frameon=False, dpi=100, figsize=(26 / 100, 9 / 100))
×
NEW
253
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
254
        fig.add_axes(ax)
×
NEW
255
        ax.set_axis_off()
×
NEW
256
        ax.get_xaxis().set_visible(False)
×
NEW
257
        ax.get_yaxis().set_visible(False)
×
NEW
258
        data = np.arange(26 * 9).reshape(9, 26)
×
NEW
259
        ax.imshow(data)
×
NEW
260
        out = BytesIO()
×
NEW
261
        fig.savefig(out)
×
NEW
262
        out.seek(0)
×
NEW
263
        im = np.asarray(Image.open(out))
×
NEW
264
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
265
        self.assertEqual(True, ok)
×
NEW
266
        plt.close(fig)
×
267

NEW
268
    def test_diversity_6(self):
×
NEW
269
        fig = plt.figure(frameon=False, dpi=120, figsize=(9 / 120, 20 / 120))
×
NEW
270
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
271
        fig.add_axes(ax)
×
NEW
272
        ax.set_axis_off()
×
NEW
273
        ax.get_xaxis().set_visible(False)
×
NEW
274
        ax.get_yaxis().set_visible(False)
×
NEW
275
        data = np.arange(9 * 20).reshape(20, 9)
×
NEW
276
        ax.imshow(data)
×
NEW
277
        out = BytesIO()
×
NEW
278
        fig.savefig(out)
×
NEW
279
        out.seek(0)
×
NEW
280
        im = np.asarray(Image.open(out))
×
NEW
281
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
282
        self.assertEqual(True, ok)
×
NEW
283
        plt.close(fig)
×
284

NEW
285
    def test_diversity_7(self):
×
NEW
286
        fig = plt.figure(frameon=False, dpi=80, figsize=(14 / 80, 8 / 80))
×
NEW
287
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
288
        fig.add_axes(ax)
×
NEW
289
        ax.set_axis_off()
×
NEW
290
        ax.get_xaxis().set_visible(False)
×
NEW
291
        ax.get_yaxis().set_visible(False)
×
NEW
292
        data = np.arange(14 * 8).reshape(8, 14)
×
NEW
293
        ax.imshow(data)
×
NEW
294
        out = BytesIO()
×
NEW
295
        fig.savefig(out)
×
NEW
296
        out.seek(0)
×
NEW
297
        im = np.asarray(Image.open(out))
×
NEW
298
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
299
        self.assertEqual(True, ok)
×
NEW
300
        plt.close(fig)
×
301

NEW
302
    def test_diversity_8(self):
×
NEW
303
        fig = plt.figure(frameon=False, dpi=150, figsize=(13 / 150, 8 / 150))
×
NEW
304
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
305
        fig.add_axes(ax)
×
NEW
306
        ax.set_axis_off()
×
NEW
307
        ax.get_xaxis().set_visible(False)
×
NEW
308
        ax.get_yaxis().set_visible(False)
×
NEW
309
        data = np.arange(13 * 8).reshape(8, 13)
×
NEW
310
        ax.imshow(data)
×
NEW
311
        out = BytesIO()
×
NEW
312
        fig.savefig(out)
×
NEW
313
        out.seek(0)
×
NEW
314
        im = np.asarray(Image.open(out))
×
NEW
315
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
316
        self.assertEqual(True, ok)
×
NEW
317
        plt.close(fig)
×
318

NEW
319
    def test_diversity_9(self):
×
NEW
320
        fig = plt.figure(frameon=False, dpi=80, figsize=(12 / 80, 16 / 80))
×
NEW
321
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
322
        fig.add_axes(ax)
×
NEW
323
        ax.set_axis_off()
×
NEW
324
        ax.get_xaxis().set_visible(False)
×
NEW
325
        ax.get_yaxis().set_visible(False)
×
NEW
326
        data = np.arange(12 * 16).reshape(16, 12)
×
NEW
327
        ax.imshow(data)
×
NEW
328
        out = BytesIO()
×
NEW
329
        fig.savefig(out)
×
NEW
330
        out.seek(0)
×
NEW
331
        im = np.asarray(Image.open(out))
×
NEW
332
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
333
        self.assertEqual(True, ok)
×
NEW
334
        plt.close(fig)
×
335

NEW
336
    def test_diversity_10(self):
×
NEW
337
        fig = plt.figure(frameon=False, dpi=120, figsize=(8 / 120, 15 / 120))
×
NEW
338
        ax = plt.Axes(fig, [0.0, 0.0, 1.0, 1.0])
×
NEW
339
        fig.add_axes(ax)
×
NEW
340
        ax.set_axis_off()
×
NEW
341
        ax.get_xaxis().set_visible(False)
×
NEW
342
        ax.get_yaxis().set_visible(False)
×
NEW
343
        data = np.arange(8 * 15).reshape(15, 8)
×
NEW
344
        ax.imshow(data)
×
NEW
345
        out = BytesIO()
×
NEW
346
        fig.savefig(out)
×
NEW
347
        out.seek(0)
×
NEW
348
        im = np.asarray(Image.open(out))
×
NEW
349
        ok = bool((im[:, :, 3] == 255).all() and (not (im[:, :, :3] == 255).all()))
×
NEW
350
        self.assertEqual(True, ok)
×
NEW
351
        plt.close(fig)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc