Skip to content

Added test for tricontour in test_datetime.py #27494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions lib/matplotlib/tests/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,19 @@ def test_tricontour(self):
fig, ax = plt.subplots()
ax.tricontour(...)

@pytest.mark.xfail(reason="Test for tricontourf not written yet")
@mpl.style.context("default")
def test_tricontourf(self):
fig, ax = plt.subplots()
ax.tricontourf(...)
def test_tricontour(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you wrote the test for tricontour (the unfilled variant), but deleted the stub for tricontourf (the filled variant)

mpl.rcParams["date.converter"] = "concise"
fig, ax = plt.subplots()
range_threshold = 10
np.random.seed(19680801)
x_dates = np.array(
[datetime.datetime(2023, 10, n) for n in range(1, range_threshold)]
)
x_dates_numeric = mpl.dates.date2num(x_dates)
y_data = np.random.rand(range_threshold - 1) * range_threshold
z_data = np.sin(x_dates_numeric) + y_data**2


@pytest.mark.xfail(reason="Test for tripcolor not written yet")
@mpl.style.context("default")
Expand Down