Skip to content

Commit

Permalink
TST: Set MPLBACKEND=Agg on test invocations
Browse files Browse the repository at this point in the history
We do not need to use a gui method of plotting for test runs, and other
backends may fail on CI.
  • Loading branch information
mferrera committed Feb 8, 2024
1 parent 90dea77 commit 90f0d11
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup common stuff for pytests."""

import os

import pytest
Expand Down Expand Up @@ -65,6 +66,15 @@ def pytest_addoption(parser):
)


def pytest_configure(config):
# Set the Agg backend for all test runs. This should be removed once
# xtgeo.plot is removed. This is to ensure that CI runs do not fail
# on Windows and macOS.
import matplotlib as mpl

mpl.use("Agg")


@pytest.fixture(name="generate_plot")
def fixture_generate_plot(request):
if "ROXENV" in os.environ:
Expand Down

0 comments on commit 90f0d11

Please sign in to comment.