Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
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
OpenEdx
pystache_custom
Commits
e1a91258
Commit
e1a91258
authored
Apr 20, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted comments in pystache/tests/main.py.
parent
3e2ee32d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
pystache/tests/main.py
+10
-18
No files found.
pystache/tests/main.py
View file @
e1a91258
...
...
@@ -17,23 +17,7 @@ from pystache.tests.doctesting import get_module_doctests
UNITTEST_FILE_PREFIX
=
"test_"
# TODO: enhance this to work with doctests (instead of using the load_tests
# protocol), etc.
# Notes for TODO:
#
# The function unittest.main() is an alias for unittest.TestProgram's
# constructor. The constructor calls self.runTests() as its final step, which
# expects self.test to be set. The constructor sets the self.test attribute
# by calling one of self.testLoader's "loadTests" methods. These methods
# return a unittest.TestSuite instance. Thus, self.test is set to a TestSuite
# instance prior to calling runTests().
#
# Our strategy is to subclass unittest.TestProgram and override its runTests()
# method. Our implementation of runTests() will add to self.test additional
# TestCase or TestSuite instances (e.g. doctests and spec tests), and then
# call the base class's runTests().
# TODO: enhance this function to create spec-test tests.
def
run_tests
(
sys_argv
):
"""
Run all tests in the project.
...
...
@@ -136,7 +120,13 @@ def _discover_test_modules(package_dir):
return
modules
# The function unittest.main() is an alias for unittest.TestProgram's
# constructor. TestProgram's constructor calls self.runTests() as its
# final step, which expects self.test to be set. The constructor sets
# the self.test attribute by calling one of self.testLoader's "loadTests"
# methods prior to callint self.runTests(). Each loadTest method returns
# a unittest.TestSuite instance. Thus, self.test is set to a TestSuite
# instance prior to calling runTests().
class
_PystacheTestProgram
(
TestProgram
):
"""
...
...
@@ -146,6 +136,8 @@ class _PystacheTestProgram(TestProgram):
def
runTests
(
self
):
doctest_suites
=
get_module_doctests
()
# self.test is a unittest.TestSuite instance:
# http://docs.python.org/library/unittest.html#unittest.TestSuite
self
.
test
.
addTests
(
doctest_suites
)
TestProgram
.
runTests
(
self
)
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