From 3eca7c3fe82774ef9787aa2d6c4f4afa036d7925 Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Mon, 25 Feb 2008 22:20:53 +0000 Subject: [PATCH] initialize twill before servers, and pass over crashed servers on cleanup --- tests/integration/saml2/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/integration/saml2/__init__.py b/tests/integration/saml2/__init__.py index 41f79377..2f427932 100644 --- a/tests/integration/saml2/__init__.py +++ b/tests/integration/saml2/__init__.py @@ -24,6 +24,9 @@ def setup(): print >> sys.stderr, 'Create it or edit tests/config.py to match your local installation' sys.exit(1) + twill.commands.reset_browser() + twill.set_output(file('/dev/null', 'w')) + os.mkdir('/tmp/.tests') sp = subprocess.Popen([AUTHENTICCTL, 'start', '--app-dir', '/tmp/.tests/authentictests', @@ -39,12 +42,12 @@ def setup(): time.sleep(2) # let process bind ports - twill.commands.reset_browser() - twill.set_output(file('/dev/null', 'w')) - def teardown(): for pid in pids: - os.kill(pid, signal.SIGTERM) + try: + os.kill(pid, signal.SIGTERM) + except OSError: + print >> sys.stderr, 'failed to kill pid %s' % pid os.system('rm -rf /tmp/.tests/')