is this not better as a pytest fixture?