Skip to content

Commit

Permalink
Tests for font file at location, instead of GITHUB_ACTION env
Browse files Browse the repository at this point in the history
  • Loading branch information
HinTak committed Nov 7, 2024
1 parent 631e48e commit c1a6a5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,12 @@ def test_FontMetrics_hasStrikeoutPosition(fontmetrics):
@pytest.fixture
def color_emoji_run():
if sys.platform.startswith("linux"):
if (os.getenv("GITHUB_ACTION") == True):
if os.path.exists("/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf"): # Ubuntu CI
# Ubuntu is weird - the font is on disk but not accessible to fontconfig
# - Possibly https://bugs.launchpad.net/bugs/2054924
typeface = skia.Typeface.MakeFromFile("/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf")
elif os.path.exists("/usr/share/fonts/google-noto-color-emoji-fonts/NotoColorEmoji.ttf"): # Fedora
typeface = skia.Typeface.MakeFromFile("/usr/share/fonts/google-noto-color-emoji-fonts/NotoColorEmoji.ttf")
else:
pytest.skip("Not in Ubuntu CI")
if sys.platform.startswith("darwin"):
Expand All @@ -679,6 +681,7 @@ def color_emoji_run():
run = [x for x in blob]
return run[0]

# We want this exactly two (and not three) on all platforms, under all circumstances; no conditionals.
def test_emoji_count(color_emoji_run):
assert (color_emoji_run.fGlyphCount == 2)

Expand Down

0 comments on commit c1a6a5d

Please sign in to comment.