Testing utilities for ObsPy.

copyright:The ObsPy Development Team (devs@obspy.org)
license:GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html)

Public Functions

add_doctests Function to add all available doctests of the module with given name (e.g.
add_unittests Function to add all available unittests of the module with given name (e.g.
compare_images Custom version of matplotlib.testing.compare.compare_images().
compare_xml_strings Simple helper function to compare two XML strings.
create_diverse_catalog Create a catalog with a single event that has many features.
get_all_py_files Return a list with full absolute paths to all .py files in ObsPy file tree.
remove_unique_ids Removes unique ID parts of e.g. ‘publicID=”...”’ attributes from xml
setup_context_testcase Use a contextmanager to set up a unittest test case.
streams_almost_equal Return True if two streams are almost equal.
traces_almost_equal Return True if the two traces are almost equal.
write_png Custom write_png() function.

Private Functions


Private functions are mainly for internal/developer use and their API might change without notice.

_make_stats_dict Return a dict of stats from trace optionally including processing.


ImageComparison Handles the comparison against a baseline image in an image test.
WarningsCapture Try hard to capture all warnings.