Azure Databricks Python Test Coverage report

Nilave
New Contributor III

Hi,

I'm trying to enable coverage report for Azure Databricks python code. Found a solution using pytest with databricks connect but faced below challenges

  1. Pytest framework using Databricks Connect:- This works for simple notebooks. But doesnt work for below
    1. MAGIC commands doesnt work - %run, %sh doesnt works in databricks connect . Ref python 3.x - Execute databricks magic command from PyCharm IDE - Stack Overflow
  2. DButils.widget doesnt work in Databricks connect - Ref - DBUtils cannot find widgets [Windows 10] (databricks.com)

Is there any solution available for getting a coverage report without making much changes in the existing source notebooks.