instancer_test: use caplog fixture
This commit is contained in:
parent
3d5f5c0a36
commit
499d97464d
@ -12,9 +12,9 @@ from fontTools.varLib.mvar import MVAR_ENTRIES
|
|||||||
from fontTools.varLib import builder
|
from fontTools.varLib import builder
|
||||||
from fontTools.varLib import featureVars
|
from fontTools.varLib import featureVars
|
||||||
from fontTools.varLib import models
|
from fontTools.varLib import models
|
||||||
from fontTools.misc.loggingTools import CapturingLogHandler
|
|
||||||
import collections
|
import collections
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import pytest
|
import pytest
|
||||||
@ -1307,7 +1307,7 @@ class InstantiateFeatureVariationsTest(object):
|
|||||||
else:
|
else:
|
||||||
assert not gsub.FeatureList.FeatureRecord
|
assert not gsub.FeatureList.FeatureRecord
|
||||||
|
|
||||||
def test_unsupported_condition_format(self):
|
def test_unsupported_condition_format(self, caplog):
|
||||||
font = makeFeatureVarsFont(
|
font = makeFeatureVarsFont(
|
||||||
[
|
[
|
||||||
(
|
(
|
||||||
@ -1321,13 +1321,13 @@ class InstantiateFeatureVariationsTest(object):
|
|||||||
assert len(rec1.ConditionSet.ConditionTable) == 2
|
assert len(rec1.ConditionSet.ConditionTable) == 2
|
||||||
rec1.ConditionSet.ConditionTable[0].Format = 2
|
rec1.ConditionSet.ConditionTable[0].Format = 2
|
||||||
|
|
||||||
with CapturingLogHandler("fontTools.varLib.instancer", "WARNING") as captor:
|
with caplog.at_level(logging.WARNING, logger="fontTools.varLib.instancer"):
|
||||||
instancer.instantiateFeatureVariations(font, {"wdth": 0})
|
instancer.instantiateFeatureVariations(font, {"wdth": 0})
|
||||||
|
|
||||||
captor.assertRegex(
|
assert (
|
||||||
r"Condition table 0 of FeatureVariationRecord 0 "
|
"Condition table 0 of FeatureVariationRecord 0 "
|
||||||
r"has unsupported format \(2\); ignored"
|
"has unsupported format (2); ignored"
|
||||||
)
|
) in caplog.text
|
||||||
|
|
||||||
# check that record with unsupported condition format (but whose other
|
# check that record with unsupported condition format (but whose other
|
||||||
# conditions do not reference pinned axes) is kept as is
|
# conditions do not reference pinned axes) is kept as is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user