From 0f33634a9ea468152404228f5da660ab8adbe343 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 15 Aug 2022 12:10:13 +0200 Subject: [PATCH] subset_test: fix mock test with uharfbuzz>=0.30 new 'repack_with_tag' method --- Tests/subset/subset_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/subset/subset_test.py b/Tests/subset/subset_test.py index 49e847e95..7efcb698b 100644 --- a/Tests/subset/subset_test.py +++ b/Tests/subset/subset_test.py @@ -819,13 +819,20 @@ class SubsetTest: if not have_uharfbuzz: pytest.skip("uharfbuzz is not installed") if not ok: - # pretend hb.repack returns an error + # pretend hb.repack/repack_with_tag return an error import uharfbuzz as hb def mock_repack(data, obj_list): raise hb.RepackerError("mocking") monkeypatch.setattr(hb, "repack", mock_repack) + + if hasattr(hb, "repack_with_tag"): # uharfbuzz >= 0.30.0 + + def mock_repack_with_tag(tag, data, obj_list): + raise hb.RepackerError("mocking") + + monkeypatch.setattr(hb, "repack_with_tag", mock_repack_with_tag) else: if have_uharfbuzz: # pretend uharfbuzz is not installed