mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
Cleanup runtests/runcoverage
This commit is contained in:
parent
af5c3c3bf4
commit
33580c82b3
|
@ -8,6 +8,9 @@ Useful tool to run the test suite for rest_framework and generate a coverage rep
|
||||||
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
|
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
# fix sys path so we don't need to setup PYTHONPATH
|
||||||
|
sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework.runtests.settings'
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework.runtests.settings'
|
||||||
|
|
||||||
from coverage import coverage
|
from coverage import coverage
|
||||||
|
@ -55,6 +58,12 @@ def main():
|
||||||
if 'compat.py' in files:
|
if 'compat.py' in files:
|
||||||
files.remove('compat.py')
|
files.remove('compat.py')
|
||||||
|
|
||||||
|
# Same applies to template tags module.
|
||||||
|
# This module has to include branching on Django versions,
|
||||||
|
# so it's never possible for it to have full coverage.
|
||||||
|
if 'rest_framework.py' in files:
|
||||||
|
files.remove('rest_framework.py')
|
||||||
|
|
||||||
cov_files.extend([os.path.join(path, file) for file in files if file.endswith('.py')])
|
cov_files.extend([os.path.join(path, file) for file in files if file.endswith('.py')])
|
||||||
|
|
||||||
cov.report(cov_files)
|
cov.report(cov_files)
|
||||||
|
|
|
@ -5,11 +5,9 @@
|
||||||
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
|
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
"""
|
|
||||||
Need to fix sys path so following works without specifically messing with PYTHONPATH
|
# fix sys path so we don't need to setup PYTHONPATH
|
||||||
python ./rest_framework/runtests/runtests.py
|
sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))
|
||||||
"""
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))
|
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework.runtests.settings'
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'rest_framework.runtests.settings'
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
Loading…
Reference in New Issue
Block a user