Fix warnings support for upcoming pytest 6.0.