Email [Python-projects] How can we disable warning for doctest support

subject
[Python-projects] How can we disable warning for doctest support
date
2006/02/22 11:36
Bonjour!

Pylint (0.9.0, release) generates a ``[W0406, _test] Module import itself ``
warning for modules that supports doctest unit test.  Such module typically have
the following code at the end of the file:

For example, my action.py module ends with the following code

# --------------------------------------------------------------------
# -- Support for automatic testing of docstrings --
#
def _test():
    """_test() perform docstring test"""
    import doctest, action
    return doctest.testmod(action)

# ------------------------------------------------------------------
if __name__ == "__main__":
    _test()
# ------------------------------------------------------------------


I don't want to disable W0406 globally, is this the only alternative today?

If that's the case, is there any plan to better support doctest testing in the
future or is there a better way for wrting doctest support than what I have
shown above?


Thanks!

--
Pierre Rouleau


_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects