Skip to content

Commit fd16b35

Browse files
committed
raising revision for test_bar in test_datetime.py
1 parent d1c0bcd commit fd16b35

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,23 @@ def test_axvspan(self):
9090
@mpl.style.context("default")
9191
def test_bar(self):
9292
mpl.rcParams["date.converter"] = "concise"
93-
range_threshold = 10
94-
fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, layout="constrained")
93+
94+
fig, (ax1, ax2) = plt.subplots(2, 1, layout="constrained")
9595

9696
x_dates = np.array(
97-
[datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)],
97+
[
98+
datetime(2020, 6, 30),
99+
datetime(2020, 7, 22),
100+
datetime(2020, 8, 3),
101+
datetime(2020, 9, 14),
102+
],
98103
dtype=np.datetime64,
99104
)
100-
y_dates = np.array(
101-
[datetime.datetime(2023, 10, delta) for delta in range(1, range_threshold)],
102-
dtype=np.datetime64,
103-
)
104-
x_ranges = np.array(range(1, range_threshold))
105-
y_ranges = np.array(range(1, range_threshold))
105+
x_ranges = [8800, 2600, 8500, 7400]
106106

107-
ax1.bar(x_dates, y_ranges, width=np.timedelta64(range_threshold, "D"))
108-
ax2.bar(x_dates, y_dates, width=np.timedelta64(range_threshold, "D"))
109-
ax3.bar(x_ranges, y_dates, width=np.timedelta64(range_threshold, "D"))
110-
ax4.bar(x_ranges, y_ranges, bottom=datetime.datetime(2023, 10, 1))
107+
x = np.datetime64(datetime(2020, 6, 1))
108+
ax1.bar(x_dates, x_ranges, width=np.timedelta64(4, "D"))
109+
ax2.bar(np.arange(4), x_dates, bottom=x)
111110

112111
@pytest.mark.xfail(reason="Test for bar_label not written yet")
113112
@mpl.style.context("default")

0 commit comments

Comments
 (0)