Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
2717360d
Commit
2717360d
authored
Feb 06, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make this work with non-Django test suites also.
parent
5e288b60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
runone.py
+22
-10
No files found.
runone.py
View file @
2717360d
#!/usr/bin/env python
from
django.core
import
management
import
argparse
import
os
...
...
@@ -42,21 +41,34 @@ def main(argv):
test_py_path
=
find_full_path
(
test_py_path
)
test_spec
=
"
%
s:
%
s.
%
s"
%
(
test_py_path
,
test_class
,
test_method
)
settings
=
None
if
test_py_path
.
startswith
(
'cms'
):
settings
=
'cms.envs.test'
elif
test_py_path
.
startswith
(
'lms'
):
settings
=
'lms.envs.test'
else
:
raise
Exception
(
"Couldn't determine settings to use!"
)
django_args
=
[
"django-admin.py"
,
"test"
,
"--pythonpath=."
]
django_args
.
append
(
"--settings=
%
s"
%
settings
)
if
args
.
nocapture
:
django_args
.
append
(
"-s"
)
django_args
.
append
(
test_spec
)
if
settings
:
# Run as a django test suite
from
django.core
import
management
django_args
=
[
"django-admin.py"
,
"test"
,
"--pythonpath=."
]
django_args
.
append
(
"--settings=
%
s"
%
settings
)
if
args
.
nocapture
:
django_args
.
append
(
"-s"
)
django_args
.
append
(
test_spec
)
print
" "
.
join
(
django_args
)
management
.
execute_from_command_line
(
django_args
)
else
:
# Run as a nose test suite
import
nose.core
nose_args
=
[
"nosetests"
]
if
args
.
nocapture
:
nose_args
.
append
(
"-s"
)
nose_args
.
append
(
test_spec
)
print
" "
.
join
(
nose_args
)
nose
.
core
.
main
(
argv
=
nose_args
)
print
" "
.
join
(
django_args
)
management
.
execute_from_command_line
(
django_args
)
if
__name__
==
"__main__"
:
main
(
sys
.
argv
[
1
:])
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