From 65452698fff9dfc64a4c2c36f97d3d289ac70314 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 29 Jul 2014 17:23:09 -0700 Subject: [PATCH] visual tests: generate failure report even if you ctrl-c the process early --- tests/visual_tests/test.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py index 36d6fb06e..69aa9082b 100755 --- a/tests/visual_tests/test.py +++ b/tests/visual_tests/test.py @@ -434,18 +434,20 @@ if __name__ == "__main__": os.makedirs(visual_output_dir) reporting = Reporting(quiet, overwrite_failures) - for filename in files: - config = dict(defaults) - config.update(files[filename]) - for size in config['sizes']: - for scale_factor in config['scales']: - m = render(filename, - config, - size[0], - size[1], - config.get('bbox'), - scale_factor, - reporting) - mapnik.save_map(m, os.path.join(dirname, 'xml_output', "%s-out.xml" % filename)) - + try: + for filename in files: + config = dict(defaults) + config.update(files[filename]) + for size in config['sizes']: + for scale_factor in config['scales']: + m = render(filename, + config, + size[0], + size[1], + config.get('bbox'), + scale_factor, + reporting) + #mapnik.save_map(m, os.path.join(dirname, 'xml_output', "%s-out.xml" % filename)) + except KeyboardInterrupt: + pass sys.exit(reporting.summary())