Testing

Testing#

The functions in this module are not directly importable from the root shapely module. Instead, import them from the submodule as follows:

>>> from shapely.testing import assert_geometries_equal
assert_geometries_equal(x, y, tolerance=1e-07, equal_none=True, equal_nan=True, normalize=False, err_msg='', verbose=True)#

Raises an AssertionError if two geometry array_like objects are not equal.

Given two array_like objects, check that the shape is equal and all elements of these objects are equal. An exception is raised at shape mismatch or conflicting values. In contrast to the standard usage in shapely, no assertion is raised if both objects have NaNs/Nones in the same positions.

Parameters:
xGeometry or array_like
yGeometry or array_like
equal_nonebool, default True

Whether to consider None elements equal to other None elements.

equal_nanbool, default True

Whether to consider nan coordinates as equal to other nan coordinates.

normalizebool, default False

Whether to normalize geometries prior to comparison.

err_msgstr, optional

The error message to be printed in case of failure.

verbosebool, optional

If True, the conflicting values are appended to the error message.