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
f124d46e
Commit
f124d46e
authored
Apr 09, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminated the nosetests hack around the load_tests protocol function.
parent
b2864836
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
pystache/tests/test_doctests.py
+8
-14
setup.cfg
+2
-0
No files found.
pystache/tests/test_doctests.py
View file @
f124d46e
...
...
@@ -34,23 +34,17 @@ text_file_paths = ['README.rst']
#
# python setup.py test
#
# TODO: find a substitute for the load_tests protocol for Python versions
# before version 2.7.
#
# TODO: prevent the load_tests() function below from being interpreted as a
# unittest when running nosetests. This is causing the test count to be
# different between `python setup.py test` and `python setup.py nosetests`.
# Normally, nosetests would interpret this function as a test case (because
# its name matches the test regular expression) and call it with zero arguments
# as opposed to the required three. However, we are able to exclude it with
# an entry like the following in setup.cfg:
#
# HACK: Allowing load_tests() to be called without arguments is a hack
# to allow unit tests to be run with nose's nosetests without error.
# Otherwise, nose interprets the following function as a test case,
# raising the following error:
# exclude=load_tests
#
# TypeError: load_tests() takes exactly 3 arguments (0 given)
# TODO: find a substitute for the load_tests protocol for Python versions
# before version 2.7.
#
def
load_tests
(
loader
=
None
,
tests
=
None
,
ignore
=
None
):
if
loader
is
None
:
return
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.
...
...
setup.cfg
View file @
f124d46e
[nosetests]
with-doctest=1
doctest-extension=rst
# Prevent nose from interpreting the load_tests protocol function as a test.
exclude=load_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