Bug: assert_produces_warning(None) not raising AssertionError with warning
- [x] closes #38620
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
