Some helpers for writing tests with pytest.