Tests: fix some compatibility issues with pytest-cov