# Path: tests/base.py
# ALL_FIELDS = [
#     fields.String,
#     fields.Integer,
#     fields.Boolean,
#     fields.Float,
#     fields.Number,
#     fields.DateTime,
#     fields.Time,
#     fields.Date,
#     fields.TimeDelta,
#     fields.Dict,
#     fields.Url,
#     fields.Email,
#     fields.UUID,
#     fields.Decimal,
#     fields.IP,
#     fields.IPv4,
#     fields.IPv6,
#     fields.IPInterface,
#     fields.IPv4Interface,
#     fields.IPv6Interface,
# ]


import pytest
from marshmallow import (
    fields,
    Schema,
    ValidationError,
    EXCLUDE,
    INCLUDE,
    RAISE,
    missing,
)
from marshmallow.exceptions import StringNotCollectionError
from tests.base import ALL_FIELDS
        with pytest.warns(DeprecationWarning):
            field = FieldClass(description="Just a normal field.")
        assert field.metadata["description"] == "Just a normal field."
        field = FieldClass(
            required=True,
            dump_default=None,
            validate=lambda v: True,
            metadata={"description": "foo", "widget": "select"},
        )
        assert field.metadata == {"description": "foo", "widget": "select"}

    @pytest.mark.parametrize("FieldClass", ALL_FIELDS)
    def test_field_metadata_added_in_deprecated_style_warns(self, FieldClass):  # noqa
        # just the old style
        with pytest.warns(DeprecationWarning):
            field = FieldClass(description="Just a normal field.")
            assert field.metadata["description"] == "Just a normal field."
        # mixed styles
        with pytest.warns(DeprecationWarning):
            field = FieldClass(
                required=True,
                dump_default=None,
                validate=lambda v: True,
                description="foo",
                metadata={"widget": "select"},
            )
        assert field.metadata == {"description": "foo", "widget": "select"}


class TestDeprecatedDefaultAndMissing:

# Path: tests/base.py
# ALL_FIELDS = [
#     fields.String,
#     fields.Integer,
#     fields.Boolean,
#     fields.Float,
#     fields.Number,
#     fields.DateTime,
#     fields.Time,
#     fields.Date,
#     fields.TimeDelta,
#     fields.Dict,
#     fields.Url,
#     fields.Email,
#     fields.UUID,
#     fields.Decimal,
#     fields.IP,
#     fields.IPv4,
#     fields.IPv6,
#     fields.IPInterface,
#     fields.IPv4Interface,
#     fields.IPv6Interface,
# ]


# Path: tests/test_fields.py
import pytest
from marshmallow import (
    fields,
    Schema,
    ValidationError,
    EXCLUDE,
    INCLUDE,
    RAISE,
    missing,
)
from marshmallow.exceptions import StringNotCollectionError
from tests.base import ALL_FIELDS

        with pytest.warns(DeprecationWarning):
            field = FieldClass(description="Just a normal field.")
        assert field.metadata["description"] == "Just a normal field."
        field = FieldClass(
            required=True,
            dump_default=None,
            validate=lambda v: True,
            metadata={"description": "foo", "widget": "select"},
        )
        assert field.metadata == {"description": "foo", "widget": "select"}

    @pytest.mark.parametrize("FieldClass", ALL_FIELDS)
    def test_field_metadata_added_in_deprecated_style_warns(self, FieldClass):  # noqa
        # just the old style
        with pytest.warns(DeprecationWarning):
            field = FieldClass(description="Just a normal field.")
            assert field.metadata["description"] == "Just a normal field."
        # mixed styles
        with pytest.warns(DeprecationWarning):
            field = FieldClass(
                required=True,
                dump_default=None,
                validate=lambda v: True,
                description="foo",
                metadata={"widget": "select"},
            )
        assert field.metadata == {"description": "foo", "widget": "select"}


class TestDeprecatedDefaultAndMissing:

    @pytest.mark.parametrize("FieldClass", ALL_FIELDS)