Skip to content

Commit

Permalink
we won't run code-tests on PASS messages anymore
Browse files Browse the repository at this point in the history
because PASS results should be kept simple, with a default generic message.

(issue #4612)
  • Loading branch information
felipesanches committed Mar 27, 2024
1 parent d716fe7 commit e2c4b45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Lib/fontbakery/codetesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,8 @@ def assert_PASS(check_results, reason="with a good font...", ignore_error=None):

if ignore_error and subresult.status == ERROR:
print(ignore_error)
return None
else:
assert subresult.status == PASS
return str(subresult.message)


def assert_SKIP(check_results, reason=""):
Expand Down
8 changes: 7 additions & 1 deletion tests/checks/opentype/name_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
MacintoshLanguageID,
)
from fontbakery.message import Message
from fontbakery.result import Subresult
from fontbakery.status import INFO, WARN, PASS, FAIL, SKIP, DEBUG
from fontbakery.codetesting import (
assert_PASS,
Expand Down Expand Up @@ -332,7 +333,12 @@ def assert_name_table_check_result(
# set value
ttFont["name"].names[index].string = value.encode(name.getEncoding())
# run check
subresult = check(ttFont)[-1]
subresults = check(ttFont)
if [sr for sr in subresults if sr.status not in [INFO, DEBUG]] == []:
subresult = Subresult(PASS, Message("ok", "All looks good!"))
else:
subresult = subresults[-1]

status, message = subresult.status, subresult.message
# restore value
ttFont["name"].names[index].string = backup
Expand Down

0 comments on commit e2c4b45

Please sign in to comment.