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
e92e9b3a
Commit
e92e9b3a
authored
Apr 07, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the README doctests to `python setup.py test`.
parent
69c4e22b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletions
+39
-1
pystache/tests/common.py
+2
-1
pystache/tests/test_doctests.py
+37
-0
No files found.
pystache/tests/common.py
View file @
e92e9b3a
...
...
@@ -15,7 +15,8 @@ _TESTS_DIR = os.path.dirname(pystache.tests.__file__)
DATA_DIR
=
os
.
path
.
join
(
_TESTS_DIR
,
'data'
)
# i.e. 'pystache/tests/data'.
EXAMPLES_DIR
=
os
.
path
.
dirname
(
examples
.
__file__
)
SPEC_TEST_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
pystache
.
__file__
),
'..'
,
'ext'
,
'spec'
,
'specs'
)
PROJECT_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
pystache
.
__file__
),
'..'
)
SPEC_TEST_DIR
=
os
.
path
.
join
(
PROJECT_DIR
,
'ext'
,
'spec'
,
'specs'
)
def
get_data_path
(
file_name
):
...
...
pystache/tests/test_doctests.py
0 → 100644
View file @
e92e9b3a
# coding: utf-8
"""
Creates unittest.TestSuite instances for the doctests in the project.
"""
# This module follows the guidance documented here:
#
# http://docs.python.org/library/doctest.html#unittest-api
#
import
os
import
doctest
import
unittest
import
pystache
from
pystache.tests.common
import
PROJECT_DIR
# The paths to text files (i.e. non-module files) containing doctests.
# Paths should be OS-specific and relative to the project directory.
text_file_paths
=
[
'README.rst'
]
def
load_tests
(
loader
,
tests
,
ignore
):
# Since module_relative is False in our calls to DocFileSuite below,
# paths should be OS-specific. Moreover, we choose absolute paths
# so that the current working directory does not come into play.
# See the following for more info--
#
# http://docs.python.org/library/doctest.html#doctest.DocFileSuite
#
paths
=
[
os
.
path
.
join
(
PROJECT_DIR
,
path
)
for
path
in
text_file_paths
]
tests
.
addTests
(
doctest
.
DocFileSuite
(
*
paths
,
module_relative
=
False
))
return
tests
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