env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) env: Add surrogate for pytest.deprecated_call for ptyest<3.9