Hello,
I was facing the same issues as the OP and was unable to resolve them using the suggested solutions.
In my case, the root cause turned out to be the cluster configuration rather than pytest or Databricks imports.
I verified this by switching to a different cluster. The new cluster was able to see the project files correctly, imports from the src folder worked, and pytest ran successfully without any changes to the project structure.
The original cluster could see the project directories but was not resolving the file contents correctly, which resulted in ModuleNotFoundError and related import issues.
Sharing this in case it helps someone facing a similar problem. Thank you!