def METHOD_NAME(pytester):
    pytester.makepyfile(myscript="""
        from openeo.internal.warnings import test_warnings
        test_warnings()
        test_warnings(2)
    """)
    result = pytester.runpython("myscript.py")
    stderr = "\n".join(result.errlines)
    assert "This is a UserDeprecationWarning (stacklevel 1)" in stderr
    assert "myscript.py:3: UserDeprecationWarning: This is a UserDeprecationWarning (stacklevel 2)" in stderr