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 de6919c

Browse filesBrowse files
committed
TST: implement plot smoke test
1 parent 6b870e7 commit de6919c
Copy full SHA for de6919c

File tree

Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed

‎lib/matplotlib/tests/test_datetime.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_datetime.py
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import datetime
2+
import numpy as np
3+
14
import pytest
25

36
import matplotlib.pyplot as plt
@@ -239,11 +242,15 @@ def test_phase_spectrum(self):
239242
fig, ax = plt.subplots()
240243
ax.phase_spectrum(...)
241244

242-
@pytest.mark.xfail(reason="Test for plot not written yet")
243245
@mpl.style.context("default")
244246
def test_plot(self):
245-
fig, ax = plt.subplots()
246-
ax.plot(...)
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)
247254

248255
@pytest.mark.xfail(reason="Test for plot_date not written yet")
249256
@mpl.style.context("default")

0 commit comments

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