From 4b97c067f71d58b97850819318dcf7f69c7bab5b Mon Sep 17 00:00:00 2001 From: ohnorobo Date: Thu, 4 Jul 2024 22:45:56 +0200 Subject: [PATCH] remove special casing in test --- test/test_generation.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/test_generation.py b/test/test_generation.py index bbf5016..3ff9f0b 100644 --- a/test/test_generation.py +++ b/test/test_generation.py @@ -41,26 +41,18 @@ def test_path_parsing(self): 'M 200,300 Q 400,50 600,300 Q 800,550 1000,300', 'M -3.4e+38,3.4e+38 L -3.4e-38,3.4e-38', 'M 0,0 L 50,20 L 200,100 L 50,20', - ('M 600,350 L 650,325 A 27.9508,27.9508 -30 0,1 700,300 L 750,275', # Python 2 - 'M 600,350 L 650,325 A 27.9508,27.9508 -30 0,1 700,300 L 750,275') # Python 3 + 'M 600,350 L 650,325 A 27.9508,27.9508 -30 0,1 700,300 L 750,275' ] for path, flpath in zip(paths[::-1], float_paths[::-1]): - # Note: Python 3 and Python 2 differ in the number of digits - # truncated when returning a string representation of a float parsed_path = parse_path(path) res = parsed_path.d() - if isinstance(flpath, tuple): - option3 = res == flpath[1] # Python 3 - flpath = flpath[0] - else: - option3 = False option1 = res == path option2 = res == flpath msg = ('\npath =\n {}\nflpath =\n {}\nparse_path(path).d() =\n {}' ''.format(path, flpath, res)) - self.assertTrue(option1 or option2 or option3, msg=msg) + self.assertTrue(option1 or option2, msg=msg) for flpath in float_paths[:-1]: res = parse_path(flpath).d()