TST: Use IPython instance fixture to avoid file leak
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them

xref https://github.com/pandas-dev/pandas/pull/44634, https://github.com/pandas-dev/pandas/pull/35836

Probably should see if anything can be done on the iPython side.

> Do you think it's likely this is the/a source of the warnings?

I want to say so. It aligns with an unclosed `BufferedRandom` since it was opened in `r+` mode.

Thanks for also raising an issue in iPython https://github.com/ipython/ipython/issues/12495