diff --git a/Lib/cu2qu/benchmark.py b/Lib/cu2qu/benchmark.py index 2ac1f4f3f..4b3f134a5 100644 --- a/Lib/cu2qu/benchmark.py +++ b/Lib/cu2qu/benchmark.py @@ -56,10 +56,10 @@ def run_test(name): def main(): - random.seed(1) run_test('curve_to_quadratic') run_test('curves_to_quadratic') if __name__ == '__main__': + random.seed(1) main() diff --git a/Lib/cu2qu/test/cu2qu_test.py b/Lib/cu2qu/test/cu2qu_test.py index 07b3dc3f5..3ef96c308 100644 --- a/Lib/cu2qu/test/cu2qu_test.py +++ b/Lib/cu2qu/test/cu2qu_test.py @@ -16,8 +16,8 @@ from __future__ import print_function, division, absolute_import import collections -import random import unittest +import random from cu2qu import curve_to_quadratic, curves_to_quadratic from cu2qu.benchmark import generate_curve @@ -31,6 +31,7 @@ class CurveToQuadraticTest(unittest.TestCase): def setUpClass(cls): """Do the curve conversion ahead of time, and run tests on results.""" + random.seed(1) curves = [generate_curve() for i in range(1000)] cls.single_splines, cls.single_errors = zip(*[ @@ -114,5 +115,4 @@ class CurveToQuadraticTest(unittest.TestCase): if __name__ == '__main__': - random.seed(1) unittest.main()