Greatly simplify tests using somewhat-hidden _pytester plugin.
Special thanks to Floris Bruynooghe for pointing me to it.