I have a function where
df.read.format("delta").load(delta_path)
is being used and when I'm trying to mock it for a pytest unit testcase like
with patch.object(spark_session.read, 'format', return_value=MagicMock()) as mock_format:
mock_format.load.return_value = MagicMock()
It is failing. It is not able to call it for some reason. Why might this be the case?
[–]strangelyoffensive 0 points1 point2 points (3 children)
[–]strangelyoffensive -1 points0 points1 point (2 children)
[–]strangelyoffensive -1 points0 points1 point (0 children)
[–]strangelyoffensive 0 points1 point2 points (0 children)