[feaLib] assert all requested tables are supported
better than just warn
This commit is contained in:
parent
b2da85cffd
commit
803530b281
@ -100,11 +100,7 @@ class Builder(object):
|
||||
else:
|
||||
tables = frozenset(tables)
|
||||
unsupported = tables - self.supportedTables
|
||||
if unsupported:
|
||||
log.warning(
|
||||
"skipped unsupported table%s: %s" % (
|
||||
"s" if len(unsupported) > 1 else "",
|
||||
", ".join(sorted(repr(tag) for tag in unsupported))))
|
||||
assert not unsupported, unsupported
|
||||
if "GSUB" in tables:
|
||||
self.build_feature_aalt_()
|
||||
if "head" in tables:
|
||||
|
@ -492,10 +492,8 @@ class BuilderTest(unittest.TestCase):
|
||||
font2 = self.build(features, tables=set())
|
||||
assert "GSUB" not in font2
|
||||
|
||||
logger = logging.getLogger("fontTools.feaLib.builder")
|
||||
with CapturingLogHandler(logger, "WARNING") as captor:
|
||||
font = self.build(features, tables=["FOOO", "BAAR"])
|
||||
captor.assertRegex("skipped unsupported tables: 'BAAR', 'FOOO'")
|
||||
def test_build_unsupported_tables(self):
|
||||
self.assertRaises(AssertionError, self.build, "", tables={"FOO"})
|
||||
|
||||
|
||||
def generate_feature_file_test(name):
|
||||
|
Loading…
x
Reference in New Issue
Block a user