Fixes #9280. Previous approach didn't support pytester being loaded using `pytest_plugins = "pytester"` in a conftest.