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
82442c33
Commit
82442c33
authored
Apr 21, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed get_module_doctests() to get_doctests().
parent
fb12f8a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
pystache/tests/doctesting.py
+8
-3
pystache/tests/main.py
+2
-2
No files found.
pystache/tests/doctesting.py
View file @
82442c33
...
...
@@ -17,9 +17,14 @@ from pystache.tests.common import PACKAGE_DIR, TEXT_DOCTEST_PATHS
# http://docs.python.org/library/doctest.html#unittest-api
#
def
get_
module_doctests
(
project
_dir
):
def
get_
doctests
(
text_file
_dir
):
"""
Return a list of TestSuite instances for all doctests in the pacakqge.
Return a list of TestSuite instances for all doctests in the project.
Arguments:
text_file_dir: the directory in which to search for all text files
(i.e. non-module files) containing doctests.
"""
suites
=
[]
...
...
@@ -29,7 +34,7 @@ def get_module_doctests(project_dir):
#
# http://docs.python.org/library/doctest.html#doctest.DocFileSuite
#
paths
=
[
os
.
path
.
normpath
(
os
.
path
.
join
(
project
_dir
,
path
))
for
path
in
TEXT_DOCTEST_PATHS
]
paths
=
[
os
.
path
.
normpath
(
os
.
path
.
join
(
text_file
_dir
,
path
))
for
path
in
TEXT_DOCTEST_PATHS
]
for
path
in
paths
:
suite
=
doctest
.
DocFileSuite
(
path
,
module_relative
=
False
)
suites
.
append
(
suite
)
...
...
pystache/tests/main.py
View file @
82442c33
...
...
@@ -12,7 +12,7 @@ import sys
from
unittest
import
TestProgram
from
pystache.tests.common
import
PACKAGE_DIR
,
PROJECT_DIR
from
pystache.tests.doctesting
import
get_
module_
doctests
from
pystache.tests.doctesting
import
get_doctests
UNITTEST_FILE_PREFIX
=
"test_"
...
...
@@ -145,7 +145,7 @@ class _PystacheTestProgram(TestProgram):
"""
def
runTests
(
self
):
doctest_suites
=
get_
module_
doctests
(
self
.
_project_dir
)
doctest_suites
=
get_doctests
(
self
.
_project_dir
)
# self.test is a unittest.TestSuite instance:
# http://docs.python.org/library/unittest.html#unittest.TestSuite
self
.
test
.
addTests
(
doctest_suites
)
...
...
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