Potential fix for #21206.

Discovery tests pass, but this introduces a failure in
test_runner.tests.DeprecationDisplayTest that I haven't debugged.