TST: groupby apply called multiple times
closes #31111 
xref https://github.com/pandas-dev/pandas/pull/24748
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ Added test for testing func should be called len(set(groupby_column)) times when passed to groupby.apply(func) ] whatsnew entry

Hello @Rohith295! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-06-20 14:58:22 UTC this is very similar to these issues
GH2936, GH7739, GH10519, GH2656, GH12155, GH20084, GH21417
which are now fixed lgtm ping on green. thanks @Rohith295 