fonttools/Lib/fontTools/feaLib/error_test.py
Cosimo Lupo 49bcbb916b
consistently do sys.exit(unittest.main()) in all test modules
So that when run as scrips they report test failures with exit code

Follow up on b7bb391033ef3255c90134da3d7aef50d2d5326d
2017-01-11 13:05:35 +00:00

20 lines
570 B
Python

from __future__ import print_function, division, absolute_import
from __future__ import unicode_literals
from fontTools.feaLib.error import FeatureLibError
import unittest
class FeatureLibErrorTest(unittest.TestCase):
def test_str(self):
err = FeatureLibError("Squeak!", ("foo.fea", 23, 42))
self.assertEqual(str(err), "foo.fea:23:42: Squeak!")
def test_str_nolocation(self):
err = FeatureLibError("Squeak!", None)
self.assertEqual(str(err), "Squeak!")
if __name__ == "__main__":
import sys
sys.exit(unittest.main())