Commit f124d46e by Chris Jerdonek

Eliminated the nosetests hack around the load_tests protocol function.

parent b2864836
...@@ -34,23 +34,17 @@ text_file_paths = ['README.rst'] ...@@ -34,23 +34,17 @@ text_file_paths = ['README.rst']
# #
# python setup.py test # python setup.py test
# #
# TODO: find a substitute for the load_tests protocol for Python versions # Normally, nosetests would interpret this function as a test case (because
# before version 2.7. # 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
# TODO: prevent the load_tests() function below from being interpreted as a # an entry like the following in setup.cfg:
# unittest when running nosetests. This is causing the test count to be
# different between `python setup.py test` and `python setup.py nosetests`.
# #
# HACK: Allowing load_tests() to be called without arguments is a hack # exclude=load_tests
# 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:
# #
# 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): def load_tests(loader, tests, ignore):
if loader is None:
return
# Since module_relative is False in our calls to DocFileSuite below, # Since module_relative is False in our calls to DocFileSuite below,
# paths should be OS-specific. Moreover, we choose absolute paths # paths should be OS-specific. Moreover, we choose absolute paths
# so that the current working directory does not come into play. # so that the current working directory does not come into play.
......
[nosetests] [nosetests]
with-doctest=1 with-doctest=1
doctest-extension=rst doctest-extension=rst
# Prevent nose from interpreting the load_tests protocol function as a test.
exclude=load_tests
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment