Skip to content

Commit b86e331

Browse files
Merge pull request #27091 from antlockyer/step-test
Add test_step to test_datetime.py
2 parents 629baa8 + ab1e1cb commit b86e331

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,15 @@ def test_stem(self):
443443
fig, ax = plt.subplots()
444444
ax.stem(...)
445445

446-
@pytest.mark.xfail(reason="Test for step not written yet")
447446
@mpl.style.context("default")
448447
def test_step(self):
449-
fig, ax = plt.subplots()
450-
ax.step(...)
448+
mpl.rcParams["date.converter"] = "concise"
449+
N = 6
450+
fig, (ax1, ax2, ax3) = plt.subplots(3, 1, layout='constrained')
451+
x = np.array([datetime.datetime(2023, 9, n) for n in range(1, N)])
452+
ax1.step(x, range(1, N))
453+
ax2.step(range(1, N), x)
454+
ax3.step(x, x)
451455

452456
@pytest.mark.xfail(reason="Test for streamplot not written yet")
453457
@mpl.style.context("default")

0 commit comments

Comments
 (0)