mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Adding examples to tox. Appears quite useful cause some example tests are broken.
This commit is contained in:
parent
fabf7c255d
commit
9215197327
27
examples/runtests.py
Normal file
27
examples/runtests.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import os
|
||||
import sys
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
||||
|
||||
from django.conf import settings
|
||||
from django.test.utils import get_runner
|
||||
|
||||
def main():
|
||||
TestRunner = get_runner(settings)
|
||||
|
||||
if hasattr(TestRunner, 'func_name'):
|
||||
# Pre 1.2 test runners were just functions,
|
||||
# and did not support the 'failfast' option.
|
||||
import warnings
|
||||
warnings.warn(
|
||||
'Function-based test runners are deprecated. Test runners should be classes with a run_tests() method.',
|
||||
DeprecationWarning
|
||||
)
|
||||
failures = TestRunner(None)
|
||||
else:
|
||||
test_runner = TestRunner()
|
||||
failures = test_runner.run_tests(None)
|
||||
|
||||
sys.exit(failures)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -105,3 +105,8 @@ INSTALLED_APPS = (
|
|||
'pygments_api',
|
||||
'blogpost',
|
||||
)
|
||||
|
||||
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
|
||||
TEST_OUTPUT_VERBOSE = True
|
||||
TEST_OUTPUT_DESCRIPTIONS = True
|
||||
TEST_OUTPUT_DIR = 'xmlrunner'
|
103
tox.ini
103
tox.ini
|
@ -1,6 +1,23 @@
|
|||
#This file is very NON-DRY because tox currently doesn't yet support interpolation like configparser does.
|
||||
#There's ticket covering this at http://code.google.com/p/pytox/issues/detail?id=17#c0
|
||||
|
||||
[tox]
|
||||
envlist=
|
||||
py25-django12, py26-django12, py27-django12, py25-django13, py26-django13, py27-django13
|
||||
py25-django12,
|
||||
py26-django12,
|
||||
py27-django12,
|
||||
py25-django13,
|
||||
py26-django13,
|
||||
py27-django13,
|
||||
|
||||
py25-django12-examples,
|
||||
py26-django12-examples,
|
||||
py27-django12-examples,
|
||||
py25-django13-examples,
|
||||
py26-django13-examples,
|
||||
py27-django13-examples
|
||||
|
||||
########################################### CORE TESTS ############################################
|
||||
|
||||
[testenv]
|
||||
commands=
|
||||
|
@ -8,7 +25,7 @@ commands=
|
|||
|
||||
[testenv:py25-django12]
|
||||
basepython=python2.5
|
||||
deps=
|
||||
deps+=
|
||||
django==1.2.4
|
||||
simplejson
|
||||
coverage==3.4
|
||||
|
@ -49,3 +66,85 @@ deps=
|
|||
http://www.djangoproject.com/download/1.3-rc-1/tarball/
|
||||
coverage==3.4
|
||||
https://github.com/downloads/markotibold/unittest-xml-reporting/unittest-xml-reporting-1.1.zip
|
||||
|
||||
####################################### EXAMPLES ################################################
|
||||
|
||||
[testenv:py25-django12-examples]
|
||||
basepython=python2.5
|
||||
commands=
|
||||
python examples/runtests.py
|
||||
deps=
|
||||
django==1.2.4
|
||||
simplejson
|
||||
coverage==3.4
|
||||
wsgiref==0.1.2
|
||||
Pygments==1.4
|
||||
httplib2==0.6.0
|
||||
Markdown==2.0.3
|
||||
https://github.com/downloads/markotibold/unittest-xml-reporting/unittest-xml-reporting-1.1.zip
|
||||
|
||||
[testenv:py26-django12-examples]
|
||||
basepython=python2.6
|
||||
commands=
|
||||
python examples/runtests.py
|
||||
deps=
|
||||
django==1.2.4
|
||||
coverage==3.4
|
||||
wsgiref==0.1.2
|
||||
Pygments==1.4
|
||||
httplib2==0.6.0
|
||||
Markdown==2.0.3
|
||||
https://github.com/downloads/markotibold/unittest-xml-reporting/unittest-xml-reporting-1.1.zip
|
||||
|
||||
[testenv:py27-django12-examples]
|
||||
basepython=python2.7
|
||||
commands=
|
||||
python examples/runtests.py
|
||||
deps=
|
||||
django==1.2.4
|
||||
coverage==3.4
|
||||
wsgiref==0.1.2
|
||||
Pygments==1.4
|
||||
httplib2==0.6.0
|
||||
Markdown==2.0.3
|
||||
https://github.com/downloads/markotibold/unittest-xml-reporting/unittest-xml-reporting-1.1.zip
|
||||
|
||||
[testenv:py25-django13-examples]
|
||||
basepython=python2.5
|
||||
commands=
|
||||
python examples/runtests.py
|
||||
deps=
|
||||
http://www.djangoproject.com/download/1.3-rc-1/tarball/
|
||||
simplejson
|
||||
coverage==3.4
|
||||
wsgiref==0.1.2
|
||||
Pygments==1.4
|
||||
httplib2==0.6.0
|
||||
Markdown==2.0.3
|
||||
https://github.com/downloads/markotibold/unittest-xml-reporting/unittest-xml-reporting-1.1.zip
|
||||
|
||||
[testenv:py26-django13-examples]
|
||||
basepython=python2.6
|
||||
commands=
|
||||
python examples/runtests.py
|
||||
deps=
|
||||
http://www.djangoproject.com/download/1.3-rc-1/tarball/
|
||||
coverage==3.4
|
||||
wsgiref==0.1.2
|
||||
Pygments==1.4
|
||||
httplib2==0.6.0
|
||||
Markdown==2.0.3
|
||||
https://github.com/downloads/markotibold/unittest-xml-reporting/unittest-xml-reporting-1.1.zip
|
||||
|
||||
[testenv:py27-django13-examples]
|
||||
basepython=python2.7
|
||||
commands=
|
||||
python examples/runtests.py
|
||||
deps=
|
||||
http://www.djangoproject.com/download/1.3-rc-1/tarball/
|
||||
coverage==3.4
|
||||
wsgiref==0.1.2
|
||||
Pygments==1.4
|
||||
httplib2==0.6.0
|
||||
Markdown==2.0.3
|
||||
https://github.com/downloads/markotibold/unittest-xml-reporting/unittest-xml-reporting-1.1.zip
|
Loading…
Reference in New Issue
Block a user