STYLE: dont use pd api types in tests
- [x] closes #39203 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [] whatsnew entry

I didn't add a whatsnew entry since it's only style fixes.
I'll open a new issue regarding @jreback suggestion to ban this with a precommit style rule.
I prefer it to be done in a different PR.
Thanks @nofarm3 

> I'll open a new issue regarding @jreback suggestion to ban this with a precommit style rule.
I prefer it to be done in a different PR.

Any chance this could be done in the same PR, so that it can be seen to be fixed? This is analogous to adding tests in the same PR in which one fixes a bug @MarcoGorelli 
 Yes it make sense. no problem I'll add this to this PR. sure - do ask if it's not something you're familiar with, I think it should be enough to just add a line to the `non-standard-imports-in-tests` hook @MarcoGorelli 
I added a hook that validates there is no usage in ```pd.api.types``` under ```pandas/tests/```. 
Do you think it's good enough for now? I'm finished, lmk if you want to see anything more. thanks @nofarm3 