From 9025c729c720fef5511a96205f1af079b700be07 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 16 Oct 2013 23:03:40 -0400 Subject: [PATCH] removed Popen wait and use communicate then get return code --- tests/test_basic/test_basic.py | 2 +- tests/test_cmfd_feed/test_cmfd_feed.py | 2 +- tests/test_cmfd_jfnk/test_cmfd_jfnk.py | 2 +- tests/test_cmfd_nofeed/test_cmfd_nofeed.py | 2 +- tests/test_compile/test_compile.py | 2 +- .../test_confidence_intervals.py | 2 +- tests/test_density_atombcm/test_density_atombcm.py | 2 +- tests/test_density_atomcm3/test_density_atomcm3.py | 2 +- tests/test_density_kgm3/test_density_kgm3.py | 2 +- tests/test_density_sum/test_density_sum.py | 2 +- .../test_eigenvalue_genperbatch.py | 2 +- .../test_eigenvalue_no_inactive.py | 2 +- tests/test_energy_grid/test_energy_grid.py | 2 +- tests/test_entropy/test_entropy.py | 2 +- tests/test_filter_cell/test_filter_cell.py | 2 +- tests/test_filter_cellborn/test_filter_cellborn.py | 2 +- tests/test_filter_energy/test_filter_energy.py | 2 +- tests/test_filter_energyout/test_filter_energyout.py | 2 +- .../test_filter_group_transfer.py | 2 +- tests/test_filter_material/test_filter_material.py | 2 +- tests/test_filter_mesh_2d/test_filter_mesh_2d.py | 2 +- tests/test_filter_mesh_3d/test_filter_mesh_3d.py | 2 +- tests/test_filter_universe/test_filter_universe.py | 2 +- tests/test_fixed_source/test_fixed_source.py | 2 +- tests/test_lattice/test_lattice.py | 2 +- tests/test_lattice_multiple/test_lattice_multiple.py | 2 +- tests/test_natural_element/test_natural_element.py | 2 +- tests/test_output/test_output.py | 2 +- tests/test_plot_background/test_plot_background.py | 2 +- tests/test_plot_basis/test_plot_basis.py | 2 +- tests/test_plot_colspec/test_plot_colspec.py | 2 +- tests/test_plot_mask/test_plot_mask.py | 2 +- tests/test_ptables_off/test_ptables_off.py | 2 +- tests/test_reflective_cone/test_reflective_cone.py | 2 +- .../test_reflective_cylinder/test_reflective_cylinder.py | 2 +- tests/test_reflective_plane/test_reflective_plane.py | 2 +- tests/test_reflective_sphere/test_reflective_sphere.py | 2 +- tests/test_rotation/test_rotation.py | 2 +- tests/test_salphabeta/test_salphabeta.py | 2 +- .../test_salphabeta_multiple/test_salphabeta_multiple.py | 2 +- tests/test_score_MT/test_score_MT.py | 2 +- tests/test_score_absorption/test_score_absorption.py | 2 +- tests/test_score_current/test_score_current.py | 2 +- tests/test_score_events/test_score_events.py | 2 +- tests/test_score_fission/test_score_fission.py | 2 +- tests/test_score_flux/test_score_flux.py | 2 +- tests/test_score_kappafission/test_score_kappafission.py | 2 +- tests/test_score_nufission/test_score_nufission.py | 2 +- tests/test_score_nuscatter/test_score_nuscatter.py | 2 +- tests/test_score_scatter/test_score_scatter.py | 2 +- tests/test_score_scatter_n/test_score_scatter_n.py | 2 +- tests/test_score_scatter_pn/test_score_scatter_pn.py | 2 +- tests/test_score_total/test_score_total.py | 2 +- tests/test_seed/test_seed.py | 2 +- tests/test_source_angle_mono/test_source_angle_mono.py | 2 +- .../test_source_energy_maxwell.py | 2 +- tests/test_source_energy_mono/test_source_energy_mono.py | 2 +- tests/test_source_point/test_source_point.py | 2 +- tests/test_statepoint_batch/test_statepoint_batch.py | 2 +- .../test_statepoint_interval/test_statepoint_interval.py | 2 +- tests/test_statepoint_restart/test_statepoint_restart.py | 8 ++++---- .../test_statepoint_sourcesep.py | 2 +- tests/test_survival_biasing/test_survival_biasing.py | 2 +- tests/test_tally_assumesep/test_tally_assumesep.py | 2 +- tests/test_trace/test_trace.py | 2 +- tests/test_translation/test_translation.py | 2 +- tests/test_uniform_fs/test_uniform_fs.py | 2 +- tests/test_universe/test_universe.py | 2 +- tests/test_void/test_void.py | 2 +- 69 files changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/test_basic/test_basic.py b/tests/test_basic/test_basic.py index fe8344c15..64d20b611 100644 --- a/tests/test_basic/test_basic.py +++ b/tests/test_basic/test_basic.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_cmfd_feed/test_cmfd_feed.py b/tests/test_cmfd_feed/test_cmfd_feed.py index 59bcad866..1388ca85a 100644 --- a/tests/test_cmfd_feed/test_cmfd_feed.py +++ b/tests/test_cmfd_feed/test_cmfd_feed.py @@ -29,9 +29,9 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() output = proc.communicate()[0] print(output) + returncode = proc.returncode if 'CMFD is not available' in output: global skipAll skipAll = True diff --git a/tests/test_cmfd_jfnk/test_cmfd_jfnk.py b/tests/test_cmfd_jfnk/test_cmfd_jfnk.py index 59bcad866..1388ca85a 100644 --- a/tests/test_cmfd_jfnk/test_cmfd_jfnk.py +++ b/tests/test_cmfd_jfnk/test_cmfd_jfnk.py @@ -29,9 +29,9 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() output = proc.communicate()[0] print(output) + returncode = proc.returncode if 'CMFD is not available' in output: global skipAll skipAll = True diff --git a/tests/test_cmfd_nofeed/test_cmfd_nofeed.py b/tests/test_cmfd_nofeed/test_cmfd_nofeed.py index 07176a8f2..be7ec194a 100644 --- a/tests/test_cmfd_nofeed/test_cmfd_nofeed.py +++ b/tests/test_cmfd_nofeed/test_cmfd_nofeed.py @@ -28,9 +28,9 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() output = proc.communicate()[0] print(output) + returncode = proc.returncode if 'CMFD is not available' in output: global skipAll skipAll = True diff --git a/tests/test_compile/test_compile.py b/tests/test_compile/test_compile.py index ced2a8632..8d411abd9 100644 --- a/tests/test_compile/test_compile.py +++ b/tests/test_compile/test_compile.py @@ -273,8 +273,8 @@ def test_mpi_omp_hdf5_petsc_optimize(): def run(commands): proc = Popen(commands, stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode return returncode diff --git a/tests/test_confidence_intervals/test_confidence_intervals.py b/tests/test_confidence_intervals/test_confidence_intervals.py index a0dda8b46..a8372834f 100644 --- a/tests/test_confidence_intervals/test_confidence_intervals.py +++ b/tests/test_confidence_intervals/test_confidence_intervals.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_density_atombcm/test_density_atombcm.py b/tests/test_density_atombcm/test_density_atombcm.py index d13f40472..2fde1e631 100644 --- a/tests/test_density_atombcm/test_density_atombcm.py +++ b/tests/test_density_atombcm/test_density_atombcm.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_density_atomcm3/test_density_atomcm3.py b/tests/test_density_atomcm3/test_density_atomcm3.py index 860f858d3..74a644b59 100644 --- a/tests/test_density_atomcm3/test_density_atomcm3.py +++ b/tests/test_density_atomcm3/test_density_atomcm3.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_density_kgm3/test_density_kgm3.py b/tests/test_density_kgm3/test_density_kgm3.py index fe8344c15..64d20b611 100644 --- a/tests/test_density_kgm3/test_density_kgm3.py +++ b/tests/test_density_kgm3/test_density_kgm3.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_density_sum/test_density_sum.py b/tests/test_density_sum/test_density_sum.py index d1bc7d3a6..fcafcf0f1 100644 --- a/tests/test_density_sum/test_density_sum.py +++ b/tests/test_density_sum/test_density_sum.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py b/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py index eb4e206c1..24077bd59 100644 --- a/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py +++ b/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py b/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py index fe8344c15..64d20b611 100644 --- a/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py +++ b/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_energy_grid/test_energy_grid.py b/tests/test_energy_grid/test_energy_grid.py index fe8344c15..64d20b611 100644 --- a/tests/test_energy_grid/test_energy_grid.py +++ b/tests/test_energy_grid/test_energy_grid.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_entropy/test_entropy.py b/tests/test_entropy/test_entropy.py index fe8344c15..64d20b611 100644 --- a/tests/test_entropy/test_entropy.py +++ b/tests/test_entropy/test_entropy.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_cell/test_filter_cell.py b/tests/test_filter_cell/test_filter_cell.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_cell/test_filter_cell.py +++ b/tests/test_filter_cell/test_filter_cell.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_cellborn/test_filter_cellborn.py b/tests/test_filter_cellborn/test_filter_cellborn.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_cellborn/test_filter_cellborn.py +++ b/tests/test_filter_cellborn/test_filter_cellborn.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_energy/test_filter_energy.py b/tests/test_filter_energy/test_filter_energy.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_energy/test_filter_energy.py +++ b/tests/test_filter_energy/test_filter_energy.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_energyout/test_filter_energyout.py b/tests/test_filter_energyout/test_filter_energyout.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_energyout/test_filter_energyout.py +++ b/tests/test_filter_energyout/test_filter_energyout.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_group_transfer/test_filter_group_transfer.py b/tests/test_filter_group_transfer/test_filter_group_transfer.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_group_transfer/test_filter_group_transfer.py +++ b/tests/test_filter_group_transfer/test_filter_group_transfer.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_material/test_filter_material.py b/tests/test_filter_material/test_filter_material.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_material/test_filter_material.py +++ b/tests/test_filter_material/test_filter_material.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_mesh_2d/test_filter_mesh_2d.py b/tests/test_filter_mesh_2d/test_filter_mesh_2d.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_mesh_2d/test_filter_mesh_2d.py +++ b/tests/test_filter_mesh_2d/test_filter_mesh_2d.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_mesh_3d/test_filter_mesh_3d.py b/tests/test_filter_mesh_3d/test_filter_mesh_3d.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_mesh_3d/test_filter_mesh_3d.py +++ b/tests/test_filter_mesh_3d/test_filter_mesh_3d.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_filter_universe/test_filter_universe.py b/tests/test_filter_universe/test_filter_universe.py index 62c4d7316..151df366b 100644 --- a/tests/test_filter_universe/test_filter_universe.py +++ b/tests/test_filter_universe/test_filter_universe.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_fixed_source/test_fixed_source.py b/tests/test_fixed_source/test_fixed_source.py index 62c4d7316..151df366b 100644 --- a/tests/test_fixed_source/test_fixed_source.py +++ b/tests/test_fixed_source/test_fixed_source.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_lattice/test_lattice.py b/tests/test_lattice/test_lattice.py index fe8344c15..64d20b611 100644 --- a/tests/test_lattice/test_lattice.py +++ b/tests/test_lattice/test_lattice.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_lattice_multiple/test_lattice_multiple.py b/tests/test_lattice_multiple/test_lattice_multiple.py index fe8344c15..64d20b611 100644 --- a/tests/test_lattice_multiple/test_lattice_multiple.py +++ b/tests/test_lattice_multiple/test_lattice_multiple.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_natural_element/test_natural_element.py b/tests/test_natural_element/test_natural_element.py index fe8344c15..64d20b611 100644 --- a/tests/test_natural_element/test_natural_element.py +++ b/tests/test_natural_element/test_natural_element.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_output/test_output.py b/tests/test_output/test_output.py index 9024d6fb1..dc48dc37b 100644 --- a/tests/test_output/test_output.py +++ b/tests/test_output/test_output.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_summary_exists(): diff --git a/tests/test_plot_background/test_plot_background.py b/tests/test_plot_background/test_plot_background.py index a34b5bbfb..d8fc18f75 100644 --- a/tests/test_plot_background/test_plot_background.py +++ b/tests/test_plot_background/test_plot_background.py @@ -17,8 +17,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path, '-p'], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_plot_exists(): diff --git a/tests/test_plot_basis/test_plot_basis.py b/tests/test_plot_basis/test_plot_basis.py index fe0a13cca..86a415920 100644 --- a/tests/test_plot_basis/test_plot_basis.py +++ b/tests/test_plot_basis/test_plot_basis.py @@ -17,8 +17,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path, '-p'], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_plots_exists(): diff --git a/tests/test_plot_colspec/test_plot_colspec.py b/tests/test_plot_colspec/test_plot_colspec.py index a34b5bbfb..d8fc18f75 100644 --- a/tests/test_plot_colspec/test_plot_colspec.py +++ b/tests/test_plot_colspec/test_plot_colspec.py @@ -17,8 +17,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path, '-p'], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_plot_exists(): diff --git a/tests/test_plot_mask/test_plot_mask.py b/tests/test_plot_mask/test_plot_mask.py index fe0a13cca..86a415920 100644 --- a/tests/test_plot_mask/test_plot_mask.py +++ b/tests/test_plot_mask/test_plot_mask.py @@ -17,8 +17,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path, '-p'], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_plots_exists(): diff --git a/tests/test_ptables_off/test_ptables_off.py b/tests/test_ptables_off/test_ptables_off.py index fe8344c15..64d20b611 100644 --- a/tests/test_ptables_off/test_ptables_off.py +++ b/tests/test_ptables_off/test_ptables_off.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_reflective_cone/test_reflective_cone.py b/tests/test_reflective_cone/test_reflective_cone.py index fe8344c15..64d20b611 100644 --- a/tests/test_reflective_cone/test_reflective_cone.py +++ b/tests/test_reflective_cone/test_reflective_cone.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_reflective_cylinder/test_reflective_cylinder.py b/tests/test_reflective_cylinder/test_reflective_cylinder.py index fe8344c15..64d20b611 100644 --- a/tests/test_reflective_cylinder/test_reflective_cylinder.py +++ b/tests/test_reflective_cylinder/test_reflective_cylinder.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_reflective_plane/test_reflective_plane.py b/tests/test_reflective_plane/test_reflective_plane.py index fe8344c15..64d20b611 100644 --- a/tests/test_reflective_plane/test_reflective_plane.py +++ b/tests/test_reflective_plane/test_reflective_plane.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_reflective_sphere/test_reflective_sphere.py b/tests/test_reflective_sphere/test_reflective_sphere.py index fe8344c15..64d20b611 100644 --- a/tests/test_reflective_sphere/test_reflective_sphere.py +++ b/tests/test_reflective_sphere/test_reflective_sphere.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_rotation/test_rotation.py b/tests/test_rotation/test_rotation.py index fe8344c15..64d20b611 100644 --- a/tests/test_rotation/test_rotation.py +++ b/tests/test_rotation/test_rotation.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_salphabeta/test_salphabeta.py b/tests/test_salphabeta/test_salphabeta.py index fe8344c15..64d20b611 100644 --- a/tests/test_salphabeta/test_salphabeta.py +++ b/tests/test_salphabeta/test_salphabeta.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_salphabeta_multiple/test_salphabeta_multiple.py b/tests/test_salphabeta_multiple/test_salphabeta_multiple.py index fe8344c15..64d20b611 100644 --- a/tests/test_salphabeta_multiple/test_salphabeta_multiple.py +++ b/tests/test_salphabeta_multiple/test_salphabeta_multiple.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_MT/test_score_MT.py b/tests/test_score_MT/test_score_MT.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_MT/test_score_MT.py +++ b/tests/test_score_MT/test_score_MT.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_absorption/test_score_absorption.py b/tests/test_score_absorption/test_score_absorption.py index b49faa817..335d649dd 100644 --- a/tests/test_score_absorption/test_score_absorption.py +++ b/tests/test_score_absorption/test_score_absorption.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_current/test_score_current.py b/tests/test_score_current/test_score_current.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_current/test_score_current.py +++ b/tests/test_score_current/test_score_current.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_events/test_score_events.py b/tests/test_score_events/test_score_events.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_events/test_score_events.py +++ b/tests/test_score_events/test_score_events.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_fission/test_score_fission.py b/tests/test_score_fission/test_score_fission.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_fission/test_score_fission.py +++ b/tests/test_score_fission/test_score_fission.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_flux/test_score_flux.py b/tests/test_score_flux/test_score_flux.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_flux/test_score_flux.py +++ b/tests/test_score_flux/test_score_flux.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_kappafission/test_score_kappafission.py b/tests/test_score_kappafission/test_score_kappafission.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_kappafission/test_score_kappafission.py +++ b/tests/test_score_kappafission/test_score_kappafission.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_nufission/test_score_nufission.py b/tests/test_score_nufission/test_score_nufission.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_nufission/test_score_nufission.py +++ b/tests/test_score_nufission/test_score_nufission.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_nuscatter/test_score_nuscatter.py b/tests/test_score_nuscatter/test_score_nuscatter.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_nuscatter/test_score_nuscatter.py +++ b/tests/test_score_nuscatter/test_score_nuscatter.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_scatter/test_score_scatter.py b/tests/test_score_scatter/test_score_scatter.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_scatter/test_score_scatter.py +++ b/tests/test_score_scatter/test_score_scatter.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_scatter_n/test_score_scatter_n.py b/tests/test_score_scatter_n/test_score_scatter_n.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_scatter_n/test_score_scatter_n.py +++ b/tests/test_score_scatter_n/test_score_scatter_n.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_scatter_pn/test_score_scatter_pn.py b/tests/test_score_scatter_pn/test_score_scatter_pn.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_scatter_pn/test_score_scatter_pn.py +++ b/tests/test_score_scatter_pn/test_score_scatter_pn.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_score_total/test_score_total.py b/tests/test_score_total/test_score_total.py index 62c4d7316..151df366b 100644 --- a/tests/test_score_total/test_score_total.py +++ b/tests/test_score_total/test_score_total.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_seed/test_seed.py b/tests/test_seed/test_seed.py index fe8344c15..64d20b611 100644 --- a/tests/test_seed/test_seed.py +++ b/tests/test_seed/test_seed.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_source_angle_mono/test_source_angle_mono.py b/tests/test_source_angle_mono/test_source_angle_mono.py index fe8344c15..64d20b611 100644 --- a/tests/test_source_angle_mono/test_source_angle_mono.py +++ b/tests/test_source_angle_mono/test_source_angle_mono.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_source_energy_maxwell/test_source_energy_maxwell.py b/tests/test_source_energy_maxwell/test_source_energy_maxwell.py index fe8344c15..64d20b611 100644 --- a/tests/test_source_energy_maxwell/test_source_energy_maxwell.py +++ b/tests/test_source_energy_maxwell/test_source_energy_maxwell.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_source_energy_mono/test_source_energy_mono.py b/tests/test_source_energy_mono/test_source_energy_mono.py index fe8344c15..64d20b611 100644 --- a/tests/test_source_energy_mono/test_source_energy_mono.py +++ b/tests/test_source_energy_mono/test_source_energy_mono.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_source_point/test_source_point.py b/tests/test_source_point/test_source_point.py index fe8344c15..64d20b611 100644 --- a/tests/test_source_point/test_source_point.py +++ b/tests/test_source_point/test_source_point.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_statepoint_batch/test_statepoint_batch.py b/tests/test_statepoint_batch/test_statepoint_batch.py index 57d00dbe8..ed4f7b2a7 100644 --- a/tests/test_statepoint_batch/test_statepoint_batch.py +++ b/tests/test_statepoint_batch/test_statepoint_batch.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_statepoints_exist(): diff --git a/tests/test_statepoint_interval/test_statepoint_interval.py b/tests/test_statepoint_interval/test_statepoint_interval.py index 5c3c87fbc..263ab3790 100644 --- a/tests/test_statepoint_interval/test_statepoint_interval.py +++ b/tests/test_statepoint_interval/test_statepoint_interval.py @@ -20,8 +20,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_statepoints_exist(): diff --git a/tests/test_statepoint_restart/test_statepoint_restart.py b/tests/test_statepoint_restart/test_statepoint_restart.py index 7a880d59b..544c9197e 100644 --- a/tests/test_statepoint_restart/test_statepoint_restart.py +++ b/tests/test_statepoint_restart/test_statepoint_restart.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): @@ -45,8 +45,8 @@ def test_restart_form1(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path, '-r', statepoint[0]], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint_form1(): @@ -72,8 +72,8 @@ def test_restart_form2(): else: proc = Popen([openmc_path, '--restart', statepoint[0]], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint_form2(): @@ -94,8 +94,8 @@ def test_restart_serial(): openmc_path = pwd + '/../../src/openmc' proc = Popen([openmc_path, '--restart', statepoint[0]], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint_serial(): diff --git a/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py b/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py index 61191c57a..ca1c9966a 100644 --- a/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py +++ b/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_statepoint_exists(): diff --git a/tests/test_survival_biasing/test_survival_biasing.py b/tests/test_survival_biasing/test_survival_biasing.py index fe8344c15..64d20b611 100644 --- a/tests/test_survival_biasing/test_survival_biasing.py +++ b/tests/test_survival_biasing/test_survival_biasing.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_tally_assumesep/test_tally_assumesep.py b/tests/test_tally_assumesep/test_tally_assumesep.py index 62c4d7316..151df366b 100644 --- a/tests/test_tally_assumesep/test_tally_assumesep.py +++ b/tests/test_tally_assumesep/test_tally_assumesep.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_trace/test_trace.py b/tests/test_trace/test_trace.py index d618dfc5e..a518ab773 100644 --- a/tests/test_trace/test_trace.py +++ b/tests/test_trace/test_trace.py @@ -19,9 +19,9 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() stdout = proc.communicate()[0] print(stdout) + returncode = proc.returncode assert returncode == 0 assert stdout.find('Simulating Particle 453') != -1 diff --git a/tests/test_translation/test_translation.py b/tests/test_translation/test_translation.py index fe8344c15..64d20b611 100644 --- a/tests/test_translation/test_translation.py +++ b/tests/test_translation/test_translation.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_uniform_fs/test_uniform_fs.py b/tests/test_uniform_fs/test_uniform_fs.py index fe8344c15..64d20b611 100644 --- a/tests/test_uniform_fs/test_uniform_fs.py +++ b/tests/test_uniform_fs/test_uniform_fs.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_universe/test_universe.py b/tests/test_universe/test_universe.py index fe8344c15..64d20b611 100644 --- a/tests/test_universe/test_universe.py +++ b/tests/test_universe/test_universe.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint(): diff --git a/tests/test_void/test_void.py b/tests/test_void/test_void.py index fe8344c15..64d20b611 100644 --- a/tests/test_void/test_void.py +++ b/tests/test_void/test_void.py @@ -19,8 +19,8 @@ def test_run(): stderr=STDOUT, stdout=PIPE) else: proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() print(proc.communicate()[0]) + returncode = proc.returncode assert returncode == 0 def test_created_statepoint():