Python mocking dbutils in unittests

confused_dev
New Contributor II

I am trying to write some unittests using pytest, but I am coming accross the problem of how to mock my dbutils method when dbutils isn't being defined in my notebook.

Is there a way to do this so that I can unit test individual functions that are utilizing dbutils?