Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 04e1332

Browse filesBrowse files
authored
Merge pull request #26859 from tacaswell/tst/dt_skel
Add datetime testing skeleton
2 parents dceb278 + de6919c commit 04e1332
Copy full SHA for 04e1332

File tree

1 file changed

+397
-0
lines changed
Filter options

1 file changed

+397
-0
lines changed

‎lib/matplotlib/tests/test_datetime.py

Copy file name to clipboard
+397Lines changed: 397 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,397 @@
1+
import datetime
2+
import numpy as np
3+
4+
import pytest
5+
6+
import matplotlib.pyplot as plt
7+
import matplotlib as mpl
8+
9+
10+
class TestDatetimePlotting:
11+
@pytest.mark.xfail(reason="Test for acorr not written yet")
12+
@mpl.style.context("default")
13+
def test_acorr(self):
14+
fig, ax = plt.subplots()
15+
ax.acorr(...)
16+
17+
@pytest.mark.xfail(reason="Test for angle_spectrum not written yet")
18+
@mpl.style.context("default")
19+
def test_angle_spectrum(self):
20+
fig, ax = plt.subplots()
21+
ax.angle_spectrum(...)
22+
23+
@pytest.mark.xfail(reason="Test for annotate not written yet")
24+
@mpl.style.context("default")
25+
def test_annotate(self):
26+
fig, ax = plt.subplots()
27+
ax.annotate(...)
28+
29+
@pytest.mark.xfail(reason="Test for arrow not written yet")
30+
@mpl.style.context("default")
31+
def test_arrow(self):
32+
fig, ax = plt.subplots()
33+
ax.arrow(...)
34+
35+
@pytest.mark.xfail(reason="Test for axhline not written yet")
36+
@mpl.style.context("default")
37+
def test_axhline(self):
38+
fig, ax = plt.subplots()
39+
ax.axhline(...)
40+
41+
@pytest.mark.xfail(reason="Test for axhspan not written yet")
42+
@mpl.style.context("default")
43+
def test_axhspan(self):
44+
fig, ax = plt.subplots()
45+
ax.axhspan(...)
46+
47+
@pytest.mark.xfail(reason="Test for axline not written yet")
48+
@mpl.style.context("default")
49+
def test_axline(self):
50+
fig, ax = plt.subplots()
51+
ax.axline(...)
52+
53+
@pytest.mark.xfail(reason="Test for axvline not written yet")
54+
@mpl.style.context("default")
55+
def test_axvline(self):
56+
fig, ax = plt.subplots()
57+
ax.axvline(...)
58+
59+
@pytest.mark.xfail(reason="Test for axvspan not written yet")
60+
@mpl.style.context("default")
61+
def test_axvspan(self):
62+
fig, ax = plt.subplots()
63+
ax.axvspan(...)
64+
65+
@pytest.mark.xfail(reason="Test for bar not written yet")
66+
@mpl.style.context("default")
67+
def test_bar(self):
68+
fig, ax = plt.subplots()
69+
ax.bar(...)
70+
71+
@pytest.mark.xfail(reason="Test for bar_label not written yet")
72+
@mpl.style.context("default")
73+
def test_bar_label(self):
74+
fig, ax = plt.subplots()
75+
ax.bar_label(...)
76+
77+
@pytest.mark.xfail(reason="Test for barbs not written yet")
78+
@mpl.style.context("default")
79+
def test_barbs(self):
80+
fig, ax = plt.subplots()
81+
ax.barbs(...)
82+
83+
@pytest.mark.xfail(reason="Test for barh not written yet")
84+
@mpl.style.context("default")
85+
def test_barh(self):
86+
fig, ax = plt.subplots()
87+
ax.barh(...)
88+
89+
@pytest.mark.xfail(reason="Test for boxplot not written yet")
90+
@mpl.style.context("default")
91+
def test_boxplot(self):
92+
fig, ax = plt.subplots()
93+
ax.boxplot(...)
94+
95+
@pytest.mark.xfail(reason="Test for broken_barh not written yet")
96+
@mpl.style.context("default")
97+
def test_broken_barh(self):
98+
fig, ax = plt.subplots()
99+
ax.broken_barh(...)
100+
101+
@pytest.mark.xfail(reason="Test for bxp not written yet")
102+
@mpl.style.context("default")
103+
def test_bxp(self):
104+
fig, ax = plt.subplots()
105+
ax.bxp(...)
106+
107+
@pytest.mark.xfail(reason="Test for clabel not written yet")
108+
@mpl.style.context("default")
109+
def test_clabel(self):
110+
fig, ax = plt.subplots()
111+
ax.clabel(...)
112+
113+
@pytest.mark.xfail(reason="Test for cohere not written yet")
114+
@mpl.style.context("default")
115+
def test_cohere(self):
116+
fig, ax = plt.subplots()
117+
ax.cohere(...)
118+
119+
@pytest.mark.xfail(reason="Test for contour not written yet")
120+
@mpl.style.context("default")
121+
def test_contour(self):
122+
fig, ax = plt.subplots()
123+
ax.contour(...)
124+
125+
@pytest.mark.xfail(reason="Test for contourf not written yet")
126+
@mpl.style.context("default")
127+
def test_contourf(self):
128+
fig, ax = plt.subplots()
129+
ax.contourf(...)
130+
131+
@pytest.mark.xfail(reason="Test for csd not written yet")
132+
@mpl.style.context("default")
133+
def test_csd(self):
134+
fig, ax = plt.subplots()
135+
ax.csd(...)
136+
137+
@pytest.mark.xfail(reason="Test for errorbar not written yet")
138+
@mpl.style.context("default")
139+
def test_errorbar(self):
140+
fig, ax = plt.subplots()
141+
ax.errorbar(...)
142+
143+
@pytest.mark.xfail(reason="Test for eventplot not written yet")
144+
@mpl.style.context("default")
145+
def test_eventplot(self):
146+
fig, ax = plt.subplots()
147+
ax.eventplot(...)
148+
149+
@pytest.mark.xfail(reason="Test for fill not written yet")
150+
@mpl.style.context("default")
151+
def test_fill(self):
152+
fig, ax = plt.subplots()
153+
ax.fill(...)
154+
155+
@pytest.mark.xfail(reason="Test for fill_between not written yet")
156+
@mpl.style.context("default")
157+
def test_fill_between(self):
158+
fig, ax = plt.subplots()
159+
ax.fill_between(...)
160+
161+
@pytest.mark.xfail(reason="Test for fill_betweenx not written yet")
162+
@mpl.style.context("default")
163+
def test_fill_betweenx(self):
164+
fig, ax = plt.subplots()
165+
ax.fill_betweenx(...)
166+
167+
@pytest.mark.xfail(reason="Test for hexbin not written yet")
168+
@mpl.style.context("default")
169+
def test_hexbin(self):
170+
fig, ax = plt.subplots()
171+
ax.hexbin(...)
172+
173+
@pytest.mark.xfail(reason="Test for hist not written yet")
174+
@mpl.style.context("default")
175+
def test_hist(self):
176+
fig, ax = plt.subplots()
177+
ax.hist(...)
178+
179+
@pytest.mark.xfail(reason="Test for hist2d not written yet")
180+
@mpl.style.context("default")
181+
def test_hist2d(self):
182+
fig, ax = plt.subplots()
183+
ax.hist2d(...)
184+
185+
@pytest.mark.xfail(reason="Test for hlines not written yet")
186+
@mpl.style.context("default")
187+
def test_hlines(self):
188+
fig, ax = plt.subplots()
189+
ax.hlines(...)
190+
191+
@pytest.mark.xfail(reason="Test for imshow not written yet")
192+
@mpl.style.context("default")
193+
def test_imshow(self):
194+
fig, ax = plt.subplots()
195+
ax.imshow(...)
196+
197+
@pytest.mark.xfail(reason="Test for loglog not written yet")
198+
@mpl.style.context("default")
199+
def test_loglog(self):
200+
fig, ax = plt.subplots()
201+
ax.loglog(...)
202+
203+
@pytest.mark.xfail(reason="Test for magnitude_spectrum not written yet")
204+
@mpl.style.context("default")
205+
def test_magnitude_spectrum(self):
206+
fig, ax = plt.subplots()
207+
ax.magnitude_spectrum(...)
208+
209+
@pytest.mark.xfail(reason="Test for matshow not written yet")
210+
@mpl.style.context("default")
211+
def test_matshow(self):
212+
fig, ax = plt.subplots()
213+
ax.matshow(...)
214+
215+
@pytest.mark.xfail(reason="Test for pie not written yet")
216+
@mpl.style.context("default")
217+
def test_pie(self):
218+
fig, ax = plt.subplots()
219+
ax.pcolor(...)
220+
221+
@pytest.mark.xfail(reason="Test for pcolor not written yet")
222+
@mpl.style.context("default")
223+
def test_pcolor(self):
224+
fig, ax = plt.subplots()
225+
ax.pcolor(...)
226+
227+
@pytest.mark.xfail(reason="Test for pcolorfast not written yet")
228+
@mpl.style.context("default")
229+
def test_pcolorfast(self):
230+
fig, ax = plt.subplots()
231+
ax.pcolorfast(...)
232+
233+
@pytest.mark.xfail(reason="Test for pcolormesh not written yet")
234+
@mpl.style.context("default")
235+
def test_pcolormesh(self):
236+
fig, ax = plt.subplots()
237+
ax.pcolormesh(...)
238+
239+
@pytest.mark.xfail(reason="Test for phase_spectrum not written yet")
240+
@mpl.style.context("default")
241+
def test_phase_spectrum(self):
242+
fig, ax = plt.subplots()
243+
ax.phase_spectrum(...)
244+
245+
@mpl.style.context("default")
246+
def test_plot(self):
247+
mpl.rcParams["date.converter"] = 'concise'
248+
N = 6
249+
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout='constrained')
250+
x = np.array([datetime.datetime(2023, 9, n) for n in range(1, N)])
251+
ax1.plot(x, range(1, N))
252+
ax2.plot(range(1, N), x)
253+
ax3.plot(x, x)
254+
255+
@pytest.mark.xfail(reason="Test for plot_date not written yet")
256+
@mpl.style.context("default")
257+
def test_plot_date(self):
258+
fig, ax = plt.subplots()
259+
ax.plot_date(...)
260+
261+
@pytest.mark.xfail(reason="Test for psd not written yet")
262+
@mpl.style.context("default")
263+
def test_psd(self):
264+
fig, ax = plt.subplots()
265+
ax.psd(...)
266+
267+
@pytest.mark.xfail(reason="Test for quiver not written yet")
268+
@mpl.style.context("default")
269+
def test_quiver(self):
270+
fig, ax = plt.subplots()
271+
ax.quiver(...)
272+
273+
@pytest.mark.xfail(reason="Test for quiverkey not written yet")
274+
@mpl.style.context("default")
275+
def test_quiverkey(self):
276+
fig, ax = plt.subplots()
277+
ax.quiverkey(...)
278+
279+
@pytest.mark.xfail(reason="Test for scatter not written yet")
280+
@mpl.style.context("default")
281+
def test_scatter(self):
282+
fig, ax = plt.subplots()
283+
ax.scatter(...)
284+
285+
@pytest.mark.xfail(reason="Test for semilogx not written yet")
286+
@mpl.style.context("default")
287+
def test_semilogx(self):
288+
fig, ax = plt.subplots()
289+
ax.semilogx(...)
290+
291+
@pytest.mark.xfail(reason="Test for semilogy not written yet")
292+
@mpl.style.context("default")
293+
def test_semilogy(self):
294+
fig, ax = plt.subplots()
295+
ax.semilogy(...)
296+
297+
@pytest.mark.xfail(reason="Test for specgram not written yet")
298+
@mpl.style.context("default")
299+
def test_specgram(self):
300+
fig, ax = plt.subplots()
301+
ax.specgram(...)
302+
303+
@pytest.mark.xfail(reason="Test for spy not written yet")
304+
@mpl.style.context("default")
305+
def test_spy(self):
306+
fig, ax = plt.subplots()
307+
ax.spy(...)
308+
309+
@pytest.mark.xfail(reason="Test for stackplot not written yet")
310+
@mpl.style.context("default")
311+
def test_stackplot(self):
312+
fig, ax = plt.subplots()
313+
ax.stackplot(...)
314+
315+
@pytest.mark.xfail(reason="Test for stairs not written yet")
316+
@mpl.style.context("default")
317+
def test_stairs(self):
318+
fig, ax = plt.subplots()
319+
ax.stairs(...)
320+
321+
@pytest.mark.xfail(reason="Test for stem not written yet")
322+
@mpl.style.context("default")
323+
def test_stem(self):
324+
fig, ax = plt.subplots()
325+
ax.stem(...)
326+
327+
@pytest.mark.xfail(reason="Test for step not written yet")
328+
@mpl.style.context("default")
329+
def test_step(self):
330+
fig, ax = plt.subplots()
331+
ax.step(...)
332+
333+
@pytest.mark.xfail(reason="Test for streamplot not written yet")
334+
@mpl.style.context("default")
335+
def test_streamplot(self):
336+
fig, ax = plt.subplots()
337+
ax.streamplot(...)
338+
339+
@pytest.mark.xfail(reason="Test for table not written yet")
340+
@mpl.style.context("default")
341+
def test_table(self):
342+
fig, ax = plt.subplots()
343+
ax.table(...)
344+
345+
@pytest.mark.xfail(reason="Test for text not written yet")
346+
@mpl.style.context("default")
347+
def test_text(self):
348+
fig, ax = plt.subplots()
349+
ax.text(...)
350+
351+
@pytest.mark.xfail(reason="Test for tricontour not written yet")
352+
@mpl.style.context("default")
353+
def test_tricontour(self):
354+
fig, ax = plt.subplots()
355+
ax.tricontour(...)
356+
357+
@pytest.mark.xfail(reason="Test for tricontourf not written yet")
358+
@mpl.style.context("default")
359+
def test_tricontourf(self):
360+
fig, ax = plt.subplots()
361+
ax.tricontourf(...)
362+
363+
@pytest.mark.xfail(reason="Test for tripcolor not written yet")
364+
@mpl.style.context("default")
365+
def test_tripcolor(self):
366+
fig, ax = plt.subplots()
367+
ax.tripcolor(...)
368+
369+
@pytest.mark.xfail(reason="Test for triplot not written yet")
370+
@mpl.style.context("default")
371+
def test_triplot(self):
372+
fig, ax = plt.subplots()
373+
ax.triplot(...)
374+
375+
@pytest.mark.xfail(reason="Test for violin not written yet")
376+
@mpl.style.context("default")
377+
def test_violin(self):
378+
fig, ax = plt.subplots()
379+
ax.violin(...)
380+
381+
@pytest.mark.xfail(reason="Test for violinplot not written yet")
382+
@mpl.style.context("default")
383+
def test_violinplot(self):
384+
fig, ax = plt.subplots()
385+
ax.violinplot(...)
386+
387+
@pytest.mark.xfail(reason="Test for vlines not written yet")
388+
@mpl.style.context("default")
389+
def test_vlines(self):
390+
fig, ax = plt.subplots()
391+
ax.vlines(...)
392+
393+
@pytest.mark.xfail(reason="Test for xcorr not written yet")
394+
@mpl.style.context("default")
395+
def test_xcorr(self):
396+
fig, ax = plt.subplots()
397+
ax.xcorr(...)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.