Skip to content

Conversation

@radarhere
Copy link
Member

Adds has_feature_version() to Tests/helper.py.

This reduces some duplicate code, but also - at the moment, test_imagefontctl.py just catches a version exception

try:
draw.text((0, 0), "English あい", font=ttf, fill=500, direction="ttb")
except ValueError as ex:
if str(ex) == "libraqm 0.7 or greater required for 'ttb' direction":
pytest.skip("libraqm 0.7 or greater not available")

It is theoretically possible that our C code is throwing the exception when it shouldn't, so it is better to check the version in Python first.

@hugovk hugovk changed the title Added has_feature_version helper Add has_feature_version helper Aug 26, 2025
@hugovk hugovk merged commit f9db7a3 into python-pillow:main Aug 26, 2025
49 of 50 checks passed
@radarhere radarhere deleted the feature_version branch August 26, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants