Add try/finally in tests to make sure teardown() is called.

This commit is contained in:
Paul Romano 2014-05-27 16:51:52 -04:00
parent 692872297b
commit cbb4c1aeb9
75 changed files with 496 additions and 346 deletions

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -58,8 +58,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -59,8 +59,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -59,8 +59,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_created_output()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_created_output()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -52,7 +52,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -52,8 +52,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -63,9 +63,11 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_summary_exists()
test_cross_sections_exists()
test_statepoint_exists()
test_results()
teardown()
try:
test_run()
test_summary_exists()
test_cross_sections_exists()
test_statepoint_exists()
test_results()
finally:
teardown()

View file

@ -59,8 +59,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_restart()
test_results()
test_run_restart()
teardown()
try:
test_run()
test_created_restart()
test_results()
test_run_restart()
finally:
teardown()

View file

@ -37,6 +37,8 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_plot_exists()
teardown()
try:
test_run()
test_plot_exists()
finally:
teardown()

View file

@ -39,6 +39,8 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_plots_exists()
teardown()
try:
test_run()
test_plots_exists()
finally:
teardown()

View file

@ -37,6 +37,8 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_plot_exists()
teardown()
try:
test_run()
test_plot_exists()
finally:
teardown()

View file

@ -39,6 +39,8 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_plots_exists()
teardown()
try:
test_run()
test_plots_exists()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -109,8 +109,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run1()
test_statepoint_exists()
test_run2()
test_results()
teardown()
try:
test_run1()
test_statepoint_exists()
test_run2()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_statepoint_exists()
test_results()
teardown()
try:
test_run()
test_statepoint_exists()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_statepoint_exists()
test_results()
teardown()
try:
test_run()
test_statepoint_exists()
test_results()
finally:
teardown()

View file

@ -56,7 +56,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_statepoint_exists()
test_results()
teardown()
try:
test_run()
test_statepoint_exists()
test_results()
finally:
teardown()

View file

@ -133,16 +133,18 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
test_restart_form1()
test_created_statepoint_form1()
test_results_form1()
test_restart_form2()
test_created_statepoint_form2()
test_results_form2()
test_restart_serial()
test_created_statepoint_serial()
test_results_serial()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
test_restart_form1()
test_created_statepoint_form1()
test_results_form1()
test_restart_form2()
test_created_statepoint_form2()
test_results_form2()
test_restart_serial()
test_created_statepoint_serial()
test_results_serial()
finally:
teardown()

View file

@ -59,7 +59,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_statepoints_exist()
test_results()
teardown()
try:
test_run()
test_statepoints_exist()
test_results()
finally:
teardown()

View file

@ -68,7 +68,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_statepoints_exist()
test_results()
teardown()
try:
test_run()
test_statepoints_exist()
test_results()
finally:
teardown()

View file

@ -122,16 +122,18 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
test_restart_form1()
test_created_statepoint_form1()
test_results_form1()
test_restart_form2()
test_created_statepoint_form2()
test_results_form2()
test_restart_serial()
test_created_statepoint_serial()
test_results_serial()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
test_restart_form1()
test_created_statepoint_form1()
test_results_form1()
test_restart_form2()
test_created_statepoint_form2()
test_results_form2()
test_restart_serial()
test_created_statepoint_serial()
test_results_serial()
finally:
teardown()

View file

@ -56,7 +56,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_statepoint_exists()
test_results()
teardown()
try:
test_run()
test_statepoint_exists()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -55,8 +55,10 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_output_exists()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_output_exists()
test_results()
finally:
teardown()

View file

@ -53,7 +53,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -55,7 +55,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_outputs()
test_outputs()
teardown()
try:
test_run()
test_created_outputs()
test_outputs()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()

View file

@ -51,7 +51,9 @@ if __name__ == '__main__':
raise Exception('Must specify OpenMC executable from command line with --exe.')
# run tests
test_run()
test_created_statepoint()
test_results()
teardown()
try:
test_run()
test_created_statepoint()
test_results()
finally:
teardown()