def test_backward_warning(
    container_from_file: t.Callable[[str], ConfigDictType],
    caplog: LogCaptureFixture,
):
    OLD_HOST = """\
api_server:
  host: 0.0.0.0
"""
    with caplog.at_level(logging.WARNING):
        container_from_file(OLD_HOST)
    assert "Field 'api_server.host' is deprecated" in caplog.text
    caplog.clear()

    OLD_PORT = """\
api_server:
  port: 4096
"""
    with caplog.at_level(logging.WARNING):
        container_from_file(OLD_PORT)
    assert "Field 'api_server.port' is deprecated" in caplog.text
    caplog.clear()

    OLD_CORS = """\
api_server:
  cors:
    enabled: false
"""
    with caplog.at_level(logging.WARNING):
        container_from_file(OLD_CORS)
    assert "Field 'api_server.cors.enabled' is deprecated" in caplog.text
    caplog.clear()

    OLD_JAEGER_ADDRESS = """\
tracing:
    type: jaeger
    jaeger:
        address: localhost
"""
    with caplog.at_level(logging.WARNING):
        container_from_file(OLD_JAEGER_ADDRESS)
    assert "Field 'tracing.jaeger.address' is deprecated" in caplog.text
    caplog.clear()

    OLD_JAEGER_PORT = """\
tracing:
  type: jaeger
  jaeger:
    port: 6881
"""
    with caplog.at_level(logging.WARNING):
        container_from_file(OLD_JAEGER_PORT)
    assert "Field 'tracing.jaeger.port' is deprecated" in caplog.text
    caplog.clear()

    OLD_ZIPKIN_URL = """\
tracing:
  type: zipkin
  zipkin:
    url: localhost:6881
"""
    with caplog.at_level(logging.WARNING):
        container_from_file(OLD_ZIPKIN_URL)
    assert (
        "Field 'tracing.zipkin.url' is deprecated and has been renamed to 'tracing.zipkin.endpoint'"
        in caplog.text
    )
    caplog.clear()

    OLD_OTLP_URL = """\
tracing:
  type: otlp
  otlp:
    url: localhost:6881
"""
    with caplog.at_level(logging.WARNING):
        container_from_file(OLD_OTLP_URL)
    assert (
        "Field 'tracing.otlp.url' is deprecated and has been renamed to 'tracing.otlp.endpoint'"
        in caplog.text
    )
    caplog.clear()
with caplog.at_level(logging.WARNING):
container_from_file(OLD_HOST)
assert "Field 'api_server.host' is deprecated" in caplog.text
caplog.clear()

OLD_PORT = """\
api_server:
port: 4096
tests/unit/_internal/configuration/test_v1_migration.py