From f83a2dd996ad8f1f0807e4ef877df52d62a4ce45 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 9 Apr 2013 17:19:10 -0400 Subject: [PATCH] Change particle restart test to check for output on stderr rather than checking the return status. --- .../test_particle_restart.py | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/test_particle_restart/test_particle_restart.py b/tests/test_particle_restart/test_particle_restart.py index a69065f1b..b1f9a0108 100644 --- a/tests/test_particle_restart/test_particle_restart.py +++ b/tests/test_particle_restart/test_particle_restart.py @@ -10,21 +10,19 @@ def setup(): os.chdir(pwd) def test_run(): - proc = Popen([pwd + '/../../src/openmc'], stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() - print(proc.communicate()[0]) - assert returncode != 0 - -def test_run_restart(): - proc = Popen([pwd + '/../../src/openmc -s particle_0.binary'], - stderr=STDOUT, stdout=PIPE) - returncode = proc.wait() - print(proc.communicate()[0]) - assert returncode != 0 + proc = Popen([pwd + '/../../src/openmc'], stderr=PIPE, stdout=PIPE) + stdout, stderr = proc.communicate() + assert stderr != '' def test_created_restart(): assert os.path.exists(pwd + '/particle_0.binary') +def test_run_restart(): + proc = Popen([pwd + '/../../src/openmc -s particle_0.binary'], + stderr=PIPE, stdout=PIPE, shell=True) + stdout, stderr = proc.communicate() + assert stderr != '' + def teardown(): output = [pwd + '/particle_0.binary'] for f in output: