From 6ecfbde53f392b691c72224f3c5ce9209324161a Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 16 Jun 2007 15:01:00 +0000 Subject: [PATCH] Trapping keyboard interrupt to make sure the test teardown gets run after the test suite - Legacy-Id: 431 --- test/run | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/run b/test/run index 5c9080789..9b8b52d49 100755 --- a/test/run +++ b/test/run @@ -9,7 +9,14 @@ test/test-setup # create a patched django for test purposes, and more test/run-pyflakes ietf -PYTHONPATH=test/lib python ietf/manage.py test # run tests with our patched django +# Trap keyboard interrupt to ensure the test/teardown is run if we interrupt the tests +trap 'echo "$program($LINENO): Caught Interrupt"' INT + +# run tests with our patched django +PYTHONPATH=test/lib python ietf/manage.py test + +# reset keyboard interrupt trap +trap INT test/test-teardown