Last active
August 14, 2020 16:43
-
-
Save chrissimpkins/0f6c23b8dd46e877218e9534af58ff57 to your computer and use it in GitHub Desktop.
Fontbakery always pass custom profile for testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2020 Christopher Simpkins | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
import os | |
import sys | |
from fontbakery.checkrunner import Section, PASS, FAIL | |
from fontbakery.callable import check | |
from fontbakery.fonts_profile import profile_factory | |
profile_imports = () | |
profile = profile_factory( | |
default_section=Section("An always pass custom profile for testing") | |
) | |
ALWAYSPASS_PROFILE_CHECKS = [ | |
"com.google.fonts/check/testing/alwayspass", | |
] | |
@check( | |
id="com.google.fonts/check/testing/alwayspass", | |
rationale=""" | |
This is an always passing fontbakery check for testing purposes. | |
""", | |
) | |
def com_google_fonts_check_testing_alwayspass(ttFonts): | |
"""This is an always passing fontbakery check for testing purposes.""" | |
try: | |
tests_passed = True | |
for tt in ttFonts: | |
pass | |
if tests_passed: | |
yield PASS, "This test always passes." | |
except Exception as e: | |
sys.stderr.write("[ERROR]: {}".format(str(e))) | |
sys.exit(1) | |
# ================================================ | |
# | |
# End check definitions | |
# | |
# ================================================ | |
profile.auto_register(globals()) | |
profile.test_expected_checks(ALWAYSPASS_PROFILE_CHECKS, exclusive=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage