diff --git a/Lib/ufoLib/validators.py b/Lib/ufoLib/validators.py index 2ca789b9d..ab312337a 100644 --- a/Lib/ufoLib/validators.py +++ b/Lib/ufoLib/validators.py @@ -952,21 +952,26 @@ def fontLibValidator(value): >>> fontLibValidator(lib) (True, None) - >>> lib = {"public.glyphOrder" : [u"A", u"C", u"B"]} - >>> fontLibValidator(lib) - (True, None) - >>> lib = "hello" - >>> fontLibValidator(lib) - (False, 'The lib data is not in the correct format: expected a dictionary, found str') + >>> valid, msg = fontLibValidator(lib) + >>> valid + False + >>> print(msg) # doctest: +ELLIPSIS + The lib data is not in the correct format: expected a dictionary, ... >>> lib = {1: "hello"} - >>> fontLibValidator(lib) - (False, 'The lib key is not properly formatted: expected basestring, found int: 1') + >>> valid, msg = fontLibValidator(lib) + >>> valid + False + >>> print(msg) + The lib key is not properly formatted: expected basestring, found int: 1 >>> lib = {"public.glyphOrder" : "hello"} - >>> fontLibValidator(lib) - (False, 'public.glyphOrder is not properly formatted: expected list or tuple, found str') + >>> valid, msg = fontLibValidator(lib) + >>> valid + False + >>> print(msg) # doctest: +ELLIPSIS + public.glyphOrder is not properly formatted: expected list or tuple,... >>> lib = {"public.glyphOrder" : ["A", 1, "B"]} >>> fontLibValidator(lib) diff --git a/setup.cfg b/setup.cfg index 8534e709d..338d356fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,7 @@ license_file = LICENSE.txt minversion = 3.0.2 testpaths = ufoLib +doctest_optionflags = ALLOW_UNICODE ALLOW_BYTES addopts = -r a --doctest-modules