Skip to content

Commit cf4521d

Browse files
committed
Test cleanup: remove test database if 'python manage.py test' crashes
- Legacy-Id: 205
1 parent 3d84ba9 commit cf4521d

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

test/shell-utils

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ function py_module_file() {
4343
}
4444

4545

46-
trap 'echo "$program($LINENO): Command failed with error code $? ($0 $*)"; exit 1' ERR
46+
#trap 'echo "$program($LINENO): Command failed with error code $? ($0 $*)"; exit 1' ERR
4747

test/test-setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ cd $build
4949
settings_local=$(py_module_file "settings_local")
5050
[ "$settings_local" ] || err
5151

52-
cat $settings_local test/settings_local_test.py - > ietf/settings_local.py
52+
cat $settings_local test/settings_local_test.py > ietf/settings_local.py
5353

5454

5555
exit $warnings

test/test-teardown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ build=$PWD
1414

1515
# Database Cleanup
1616
# Make sure the test database has been removed
17-
python ietf/manage.py dbshell <<-EOT
18-
drop database test_ietf;
19-
exit;
20-
EOT
17+
if echo "show databases;" | python ietf/manage.py dbshell | grep test_ietf; then
18+
echo "drop database test_ietf;" | python ietf/manage.py dbshell
19+
echo "test database removed."
20+
fi
2121

2222
exit $warnings

0 commit comments

Comments
 (0)