Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions pygmt/tests/baseline/test_text_position_offset_with_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion pygmt/tests/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import numpy as np
import pytest
from packaging.version import Version
from pygmt import Figure, config
from pygmt.clib.session import __gmt_version__
from pygmt.exceptions import GMTCLibError, GMTParameterError, GMTTypeError
from pygmt.helpers import GMTTempFile
from pygmt.helpers.testing import skip_if_no
Expand Down Expand Up @@ -169,7 +171,12 @@ def test_text_invalid_inputs(region):
fig.text(region=region, projection="x1c", textfiles="file.txt", x=1.2, y=2.4)


@pytest.mark.mpl_image_compare
# TODO(GMT>=6.7.0): Remove the conditional filename when the minimum version is reached.
@pytest.mark.mpl_image_compare(
filename="test_text_position_offset_with_line.png"
if Version(__gmt_version__) >= Version("6.7.0")
else "test_text_position_offset_with_line_legacy.png"
)
Comment on lines +174 to +179

@seisman seisman Aug 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Use different baseline image based on GMT version, so that the test passes in both the Tests and Legacy Tests workflows.

def test_text_position_offset_with_line(region):
"""
Print text at centre middle (CM) and eight other positions (Top/Middle/Bottom x
Expand Down
Loading