polite-angle-8248004/17/2023, 1:35 AM
I also need to manually specify its
property since the plugin code I’m testing expects the mock to have it:
When trying to correctly construct objects from the various pants-native classes (e.g.
python_distributions = Mock(PythonDistribution) python_distributions.address = Address
, etc) I often run into errors and then need much more boilerplate code to create. Thoughts?
enough-analyst-5443404/17/2023, 1:40 AM
And, as a percentage, it uses mocking in less than 3% of test files:
$ find -name "*_test.py" | wc -l 428
In other words, by example, you probably shouldn't need to use mocking at all. Have you looked at how Pants tests itself yet?
polite-angle-8248004/17/2023, 1:42 AM
and saw that there were very few mocks. I’m looking through the various tests in the pants repo now, thanks