TST: GH30999 Add match=msg to all pytest.raises in tests/reductions and add an error message to nanmedian
This pull request partially addresses xref #30999 to remove bare `pytest.raises` by adding `match=msg`. It doesn't close that issue as I have only addressed test modules in the pandas/tests/reductions directory.

When going through the tests I found one case where the error message was the empty string. I decided that wasn't correct so I modified the `TypeError` to inherit the error message from the `ValueError` it was raising from. This made the error message similar to other messages in the same test.

- [ ] closes #xxxx
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

thanks @moink 