[feaLib] assert all requested tables are supported

better than just warn
This commit is contained in:
Cosimo Lupo 2018-01-24 14:39:19 -08:00
parent b2da85cffd
commit 803530b281
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482
2 changed files with 3 additions and 9 deletions

View File

@ -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:

View File

@ -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):