Skip to content

Commit 6ecfbde

Browse files
committed
Trapping keyboard interrupt to make sure the test teardown gets run after the test suite
- Legacy-Id: 431
1 parent 6afd4b8 commit 6ecfbde

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/run

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ test/test-setup # create a patched django for test purposes, and more
99

1010
test/run-pyflakes ietf
1111

12-
PYTHONPATH=test/lib python ietf/manage.py test # run tests with our patched django
12+
# Trap keyboard interrupt to ensure the test/teardown is run if we interrupt the tests
13+
trap 'echo "$program($LINENO): Caught Interrupt"' INT
14+
15+
# run tests with our patched django
16+
PYTHONPATH=test/lib python ietf/manage.py test
17+
18+
# reset keyboard interrupt trap
19+
trap INT
1320

1421
test/test-teardown
1522

0 commit comments

Comments
 (0)