From c02ac33e356be0b11b37e66f6f4c3d1961a39301 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 2 Dec 2016 12:15:01 +0000 Subject: [PATCH] py23_test: add test for second None argument --- Lib/fontTools/misc/py23_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/fontTools/misc/py23_test.py b/Lib/fontTools/misc/py23_test.py index a733b445c..96de174b9 100644 --- a/Lib/fontTools/misc/py23_test.py +++ b/Lib/fontTools/misc/py23_test.py @@ -164,6 +164,12 @@ class Round3Test(unittest.TestCase): # floats should be illegal self.assertRaises(TypeError, round3, 3.14159, 2.0) + # None should be allowed + self.assertEqual(round3(1.0, None), 1) + # the following would raise an error with the built-in Python3.5 round: + # TypeError: 'NoneType' object cannot be interpreted as an integer + self.assertEqual(round3(1, None), 1) + def test_halfway_cases(self): self.assertAlmostEqual(round3(0.125, 2), 0.12) self.assertAlmostEqual(round3(0.375, 2), 0.38)