api documentation

classes module

classes.assert_inheritance(obj, cls)

Asserts whether an object inherits from a particular class.

classes.check_is_class(class_to_check)

Raises type error if class_to_check is not a class.

classes.test_object_method(obj, …)

Test that a particular object has a given method and the (method) attribute is callable.

classes.test_object_attributes(obj, …)

Check a particular object has given attributes.

equality module

equality.assert_equal_dispatch(expected, …)

This function is used to call specific assert functions depending on the input types.

equality.assert_equal_msg(actual, expected, …)

Compares actual and expected objects and simply asserts equality (==).

equality.assert_np_nan_eqal_msg(actual, …)

Function to test that both values are np.NaN.

equality.assert_list_tuple_equal_msg(actual, …)

Compares two actual and expected list or tuple objects and asserts equality between the two.

equality.assert_dict_equal_msg(actual, …)

Compares two actual and expected dict objects and asserts equality.

equality.assert_frame_equal_msg(actual, …)

Compares actual and expected pandas.DataFrames and asserts equality.

equality.assert_series_equal_msg(actual, …)

Compares actual and expected pandas.Series and asserts equality.

equality.assert_index_equal_msg(actual, …)

Compares actual and expected pandas.Index objects and asserts equality.

equality.assert_array_equal_msg(actual, …)

Compares actual and expected np.arrays and asserts equality.

functions module

functions.assert_function_call(mocker, …)

Assert a function has been called with given arguments.

functions.assert_function_call_count(mocker, …)

Assert a function has been called a given number of times.

functions.test_function_arguments(func, …)

Test that a given function has expected arguments and default values.

pandas module

pandas.adjusted_dataframe_params(df_1, df_2)

Wrapper function to create copies of input pd.DataFrames pairs and adjust either the index of the dataframe, or split the dataframe into individual rows.

pandas.index_preserved_params(df_1, df_2[, seed])

Helper function to create copies of input pd.DataFrames pairs in a list of pytest.params where each copy has a different index (random, increasing and decreasing), the last item in the list is a pytest.param of the original inputs.

pandas.row_by_row_params(df_1, df_2)

Helper function to split input pd.DataFrames pairs into a list of pytest.params of individual row pairs and a final pytest.param of the original inputs.