Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
49a2817e
Commit
49a2817e
authored
Jun 13, 2011
by
markotibold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleted pre-Django 1.2 work-around and added a usage string.
parent
437a062b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
djangorestframework/runtests/runtests.py
+14
-12
No files found.
djangorestframework/runtests/runtests.py
View file @
49a2817e
...
@@ -13,24 +13,26 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'djangorestframework.runtests.settings'
...
@@ -13,24 +13,26 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'djangorestframework.runtests.settings'
from
django.conf
import
settings
from
django.conf
import
settings
from
django.test.utils
import
get_runner
from
django.test.utils
import
get_runner
def
usage
():
return
"""
Usage: python runtests.py [UnitTestClass].[method]
You can pass the Class name of the `UnitTestClass` you want to test.
Append a method name if you only want to test a specific method of that class.
"""
def
main
():
def
main
():
TestRunner
=
get_runner
(
settings
)
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
([
'djangorestframework'
])
else
:
test_runner
=
TestRunner
()
test_runner
=
TestRunner
()
if
len
(
sys
.
argv
)
>
1
:
if
len
(
sys
.
argv
)
==
2
:
test_case
=
'.'
+
sys
.
argv
[
1
]
test_case
=
'.'
+
sys
.
argv
[
1
]
else
:
elif
len
(
sys
.
argv
)
==
1
:
test_case
=
''
test_case
=
''
else
:
print
usage
()
sys
.
exit
(
1
)
failures
=
test_runner
.
run_tests
([
'djangorestframework'
+
test_case
])
failures
=
test_runner
.
run_tests
([
'djangorestframework'
+
test_case
])
sys
.
exit
(
failures
)
sys
.
exit
(
failures
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment