File: runtests.patch

package info (click to toggle)
django-nose 1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 340 kB
  • sloc: python: 567; sh: 29; makefile: 14
file content (36 lines) | stat: -rw-r--r-- 1,765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Description: Enable non-default python versions for test runs
 The original version of runtests.sh only allows to run the tests on the current 
 default python version. This patch add the environment variable PYTHON that can 
 be set to a specific python binary (e.g. python2.6) to run the tests with.
 It also changes the path for django-admin.py to the one supplied by the 
 python-django package.
Author: Michael Fladischer <FladischerMichael@fladi.at>
Last-Update: 2011-11-26
Forwarded: no

--- a/runtests.sh
+++ b/runtests.sh
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 export PYTHONPATH=.
+if [ -z $PYTHON ]; then
+    export PYTHON=python
+fi
 
 django_test() {
     TEST="$1"
@@ -25,8 +28,8 @@
     fi
 }
 
-django_test 'django-admin.py test --settings=testapp.settings' '2' 'normal settings'
-django_test 'django-admin.py test --settings=testapp.settings_with_south' '2' 'with south in installed apps'
-django_test 'django-admin.py test --settings=testapp.settings_old_style' '2' 'django_nose.run_tests format'
-django_test 'testapp/runtests.py testapp.test_only_this' '1' 'via run_tests API'
-django_test 'django-admin.py test --settings=testapp.settings_with_plugins testapp/plugin_t' '1' 'with plugins'
+django_test "$PYTHON /usr/bin/django-admin test --settings=testapp.settings" '2' 'normal settings'
+django_test "$PYTHON /usr/bin/django-admin test --settings=testapp.settings_with_south" '2' 'with south in installed apps'
+django_test "$PYTHON /usr/bin/django-admin test --settings=testapp.settings_old_style" '2' 'django_nose.run_tests format'
+django_test "$PYTHON testapp/runtests.py testapp.test_only_this" '1' 'via run_tests API'
+django_test "$PYTHON /usr/bin/django-admin test --settings=testapp.settings_with_plugins testapp/plugin_t" '1' 'with plugins'