File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11import io
22import os
3+ import platform
34from collections .abc import Callable , Generator
45from itertools import product
56from pathlib import Path
2829def pytest_configure (config : pytest .Config ) -> None :
2930 """Force iam-units to use a distinct cache for each worker.
3031
31- Work around for https://github.com/hgrecco/flexcache/issues/6 /
32- https://github.com/IAMconsortium/units/issues/54.
32+ Work arounds for:
33+
34+ 1. https://github.com/hgrecco/flexcache/issues/6 /
35+ https://github.com/IAMconsortium/units/issues/54.
36+ 2. https://github.com/python/cpython/issues/125235,
37+ https://github.com/astral-sh/uv/issues/7036, or similar.
3338 """
3439 name = f"iam-units-{ os .environ .get ('PYTEST_XDIST_WORKER' , '' )} " .rstrip ("-" )
3540 os .environ ["IAM_UNITS_CACHE" ] = str (config .cache .mkdir (name ))
3641
42+ if GHA and platform .system () == "Windows" :
43+ import matplotlib
44+
45+ matplotlib .use ("agg" )
46+
3747
3848def pytest_report_header (config : pytest .Config , start_path : Path ) -> str :
3949 """Add the message_ix import path to the pytest report header."""
You can’t perform that action at this time.
0 commit comments