diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index 4c72c336b88..76daa560627 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -3,6 +3,8 @@ import contextlib import inspect import math +import os +import sys from collections.abc import Callable, Generator, Hashable from copy import copy from datetime import date, timedelta @@ -12,6 +14,14 @@ import pandas as pd import pytest +# Skip this entire module on Windows when using pytest-xdist +# due to worker crashes with matplotlib FacetGrid operations +pytestmark = pytest.mark.xfail( + sys.platform == "win32" and "PYTEST_XDIST_WORKER" in os.environ, + reason="matplotlib plotting tests cause xdist worker crashes on Windows", + strict=False, # Don't fail if tests pass +) + import xarray as xr import xarray.plot as xplt from xarray import DataArray, Dataset