obspy.core.util.testing.add_doctests

add_doctests(testsuite, module_name)[source]

Function to add all available doctests of the module with given name (e.g. “obspy.core”) to the given unittest TestSuite. All submodules in the module’s root directory are added. Occurring errors are shown as warnings.

Parameters:
  • testsuite (unittest.TestSuite) testsuite to which the tests should be added
  • module_name (str) name of the module of which the tests should be added

Example

>>> import unittest
>>> suite = unittest.TestSuite()
>>> add_doctests(suite, "obspy.core")