sloria: Is `NaiveDateTime` necessary? What's the use case?
lafrech: In Python, naive and aware datetimes are different objects with different properties and some operations only work on either naive or aware datetimes. I was caught by this already (https://github.com/lepture/flask-oauthlib/issues/294). Being able to enforce the type is therefore a must have IMHO. Otherwise, the user needs to do it manually.

Whether it is done by a specific class or a flag is an implementation choice. I think different classes is better, more explicit. Generally we have a class for a type and the flags are just parameters.
sloria: It makes sense to have validation that an input datetime includes timezone info, but I'm more curious about cases when you want to enforce naiveness. Or is it more about having symmetry?
lafrech: Symmetry would be good enough a reason for me, since it is relatively easy to achieve.

[This issue](https://github.com/lepture/flask-oauthlib/issues/294) is an example of a lib that expects a naive datetime and will fail if fed an aware datetime. I don't use it anymore, but by the time, I had to enforce naiveness myself manually.

This issue can be extended to every use case involving date comparisons.

If the API stores datetimes, it most likely wants to enforce the type, if only to allow the user to sort objects by datetime. Perhaps most of the time, the DB driver will uniformize the format, by making a silent choice to force aware or naive, but I think this should be the role of the deserialization layer.

Maybe I'm missing something because once I fell into this, I figured it was something marshmallow absolutely needed to address, but since then, I heard no one complain, so maybe it is not such an issue in practice.

(In any case, I'd still consider this PR relevant, as it comes with a nice cleanup, hopefully no regression, and a code easier to maintain and with better test coverage.)
sloria: Sure, I'm fine with that reasoning and with going forward with this. Will take a closer look hopefully over the next few days.
deckar01: > I heard no one complain

I suspect loading datetimes is just not a very common behavior of most apps. Not until I made a webcam timelapse scheduler recently did I ever have to accept a datetime from the user.
lafrech: Rebased and documented.

Feedback welcome.

I'm open to changes, especially about the new parameter names. And the docs.
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8e2fd474..a05acd32 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,6 +4,16 @@ Changelog
 3.0.0 (unreleased)
 ++++++++++++++++++
 
+Features:
+
+- *Backwards-incompatible*: ``DateTime`` does not affect timezone information
+  on serialization and deserialization.
+- Add ``NaiveDateTime`` and ``AwareDateTime`` to enforce timezone awareness.
+
+Deprecations/Removals:
+
+- ``LocalDateTime`` is removed.
+
 Bug fixes:
 
 - Fix behavior of `List(Nested("self"))` (`#779 (comment) <https://github.com/marshmallow-code/marshmallow/issues/779#issuecomment-396354987>`_).
@@ -23,7 +33,7 @@ Features:
 - Improve error messages for ``validate.Range``.
 - Use ``raise from exc`` for better stack traces (:pr:`1254`). Thanks
   :user:`fuhrysteve`.
-- python-dateutil is no longer used. This resolves the inconsistent behavior 
+- python-dateutil is no longer used. This resolves the inconsistent behavior
   based on the presence of python-dateutil (:issue:`497`, :issue:`1234`).
 
 Bug fixes:
diff --git a/docs/upgrading.rst b/docs/upgrading.rst
index b87b59dd..8a827dbd 100644
--- a/docs/upgrading.rst
+++ b/docs/upgrading.rst
@@ -788,6 +788,44 @@ The ``Meta`` option ``dateformat`` used to pass format to `DateTime <marshmallow
     MySchema().dump({"x": dt.datetime(2017, 9, 19), "y": dt.date(2017, 9, 19)})
     # => {{'x': '2017-09', 'y': '09-19'}}
 
+``DateTime`` leaves timezone information untouched during serialization
+***********************************************************************
+
+``DateTime`` does not convert naive datetimes to UTC on serialization and
+``LocalDateTime`` is removed.
+
+.. code-block:: python
+
+    # 2.x
+    class MySchema(Schema):
+        x = fields.DateTime()
+        y = fields.DateTime()
+        z = fields.LocalDateTime()
+
+
+    MySchema().dump(
+        {
+            "x": dt.datetime(2017, 9, 19),
+            "y": dt.datetime(2017, 9, 19, tzinfo=dt.timezone(dt.timedelta(hours=2))),
+            "z": dt.datetime(2017, 9, 19, tzinfo=dt.timezone(dt.timedelta(hours=2))),
+        }
+    )
+    # => {{'x': '2017-09-19T00:00:00+00:00', 'y': '2017-09-18T22:00:00+00:00', 'z': '2017-09-19T00:00:00+02:00'}}
+
+    # 3.x
+    class MySchema(Schema):
+        x = fields.DateTime()
+        y = fields.DateTime()
+
+
+    MySchema().dump(
+        {
+            "x": dt.datetime(2017, 9, 19),
+            "y": dt.datetime(2017, 9, 19, tzinfo=dt.timezone(dt.timedelta(hours=2))),
+        }
+    )
+    # => {{'x': '2017-09-19T00:00:00', 'y': '2017-09-19T00:00:00+02:00'}}
+
 The ``prefix`` ``Schema`` parameter is removed
 **********************************************
 
diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py
index 69f7f2d0..e48a5305 100644
--- a/src/marshmallow/fields.py
+++ b/src/marshmallow/fields.py
@@ -11,7 +11,12 @@ from collections.abc import Mapping as _Mapping
 
 from marshmallow import validate, utils, class_registry
 from marshmallow.base import FieldABC, SchemaABC
-from marshmallow.utils import is_collection, missing as missing_, resolve_field_instance
+from marshmallow.utils import (
+    is_collection,
+    missing as missing_,
+    resolve_field_instance,
+    is_aware,
+)
 from marshmallow.exceptions import (
     ValidationError,
     StringNotCollectionError,
@@ -35,7 +40,8 @@ __all__ = [
     "Boolean",
     "Float",
     "DateTime",
-    "LocalDateTime",
+    "NaiveDateTime",
+    "AwareDateTime",
     "Time",
     "Date",
     "TimeDelta",
@@ -1027,19 +1033,13 @@ class Boolean(Field):
 
 
 class DateTime(Field):
-    """A formatted datetime string in UTC.
+    """A formatted datetime string.
 
     Example: ``'2014-12-22T03:12:58.019077+00:00'``
 
-    Timezone-naive `datetime` objects are converted to
-    UTC (+00:00) by :meth:`Schema.dump <marshmallow.Schema.dump>`.
-    :meth:`Schema.load <marshmallow.Schema.load>` returns `datetime`
-    objects that are timezone-aware.
-
     :param str format: Either ``"rfc"`` (for RFC822), ``"iso"`` (for ISO8601),
         or a date format string. If `None`, defaults to "iso".
     :param kwargs: The same keyword arguments that :class:`Field` receives.
-
     """
 
     SERIALIZATION_FUNCS = {
@@ -1062,9 +1062,9 @@ class DateTime(Field):
 
     SCHEMA_OPTS_VAR_NAME = "datetimeformat"
 
-    localtime = False
     default_error_messages = {
         "invalid": "Not a valid {obj_type}.",
+        "invalid_awareness": "Not a valid {awareness} {obj_type}.",
         "format": '"{input}" cannot be formatted as a {obj_type}.',
     }
 
@@ -1090,7 +1090,7 @@ class DateTime(Field):
         format_func = self.SERIALIZATION_FUNCS.get(data_format)
         if format_func:
             try:
-                return format_func(value, localtime=self.localtime)
+                return format_func(value)
             except (TypeError, AttributeError, ValueError):
                 self.fail("format", input=value, obj_type=self.OBJ_TYPE)
         else:
@@ -1121,15 +1121,63 @@ class DateTime(Field):
         return dt.datetime.strptime(value, data_format)
 
 
-class LocalDateTime(DateTime):
-    """A formatted datetime string in localized time, relative to UTC.
+class NaiveDateTime(DateTime):
+    """A formatted naive datetime string.
+
+    :param str format: See :class:`DateTime`.
+    :param timezone timezone: Used on deserialization. If `None`,
+        aware datetimes are rejected. If not `None`, aware datetimes are
+        converted to this timezone before their timezone information is
+        removed.
+    :param kwargs: The same keyword arguments that :class:`Field` receives.
+    """
+
+    AWARENESS = "naive"
 
-        ex. ``"Sun, 10 Nov 2013 08:23:45 -0600"``
+    def __init__(self, format=None, *, timezone=None, **kwargs):
+        super().__init__(format=format, **kwargs)
+        self.timezone = timezone
 
-    Takes the same arguments as :class:`DateTime <marshmallow.fields.DateTime>`.
+    def _deserialize(self, value, attr, data, **kwargs):
+        ret = super()._deserialize(value, attr, data, **kwargs)
+        if is_aware(ret):
+            if self.timezone is None:
+                self.fail(
+                    "invalid_awareness",
+                    awareness=self.AWARENESS,
+                    obj_type=self.OBJ_TYPE,
+                )
+            ret = ret.astimezone(self.timezone).replace(tzinfo=None)
+        return ret
+
+
+class AwareDateTime(DateTime):
+    """A formatted aware datetime string.
+
+    :param str format: See :class:`DateTime`.
+    :param timezone default_timezone: Used on deserialization. If `None`, naive
+        datetimes are rejected. If not `None`, naive datetimes are set this
+        timezone.
+    :param kwargs: The same keyword arguments that :class:`Field` receives.
     """
 
-    localtime = True
+    AWARENESS = "aware"
+
+    def __init__(self, format=None, *, default_timezone=None, **kwargs):
+        super().__init__(format=format, **kwargs)
+        self.default_timezone = default_timezone
+
+    def _deserialize(self, value, attr, data, **kwargs):
+        ret = super()._deserialize(value, attr, data, **kwargs)
+        if not is_aware(ret):
+            if self.default_timezone is None:
+                self.fail(
+                    "invalid_awareness",
+                    awareness=self.AWARENESS,
+                    obj_type=self.OBJ_TYPE,
+                )
+            ret = ret.replace(tzinfo=self.default_timezone)
+        return ret
 
 
 class Time(Field):
diff --git a/src/marshmallow/utils.py b/src/marshmallow/utils.py
index 7ee9e1f4..ce5d876e 100644
--- a/src/marshmallow/utils.py
+++ b/src/marshmallow/utils.py
@@ -137,6 +137,13 @@ class UTC(dt.tzinfo):
 UTC = utc = UTC()  # UTC is a singleton
 
 
+# https://stackoverflow.com/a/27596917
+def is_aware(datetime):
+    return (
+        datetime.tzinfo is not None and datetime.tzinfo.utcoffset(datetime) is not None
+    )
+
+
 def from_rfc(datestring):
     """Parse a RFC822-formatted datetime string and return a datetime object.
 
@@ -145,19 +152,11 @@ def from_rfc(datestring):
     return parsedate_to_datetime(datestring)
 
 
-def rfcformat(datetime, *, localtime=False):
+def rfcformat(datetime):
     """Return the RFC822-formatted representation of a datetime object.
 
     :param datetime datetime: The datetime.
-    :param bool localtime: If ``True``, return the date relative to the local
-        timezone instead of UTC, displaying the proper offset,
-        e.g. "Sun, 10 Nov 2013 08:23:45 -0600"
     """
-    if localtime and datetime.tzinfo is None:
-        datetime = UTC.localize(datetime)
-    if not localtime and datetime.tzinfo is not None:
-        # Remove timezone to format as "-0000" rather than "+0000"
-        datetime = datetime.astimezone(UTC).replace(tzinfo=None)
     return format_datetime(datetime)
 
 
@@ -236,19 +235,15 @@ def from_iso_date(value):
     return dt.date(**kw)
 
 
-def isoformat(datetime, *args, localtime=False, **kwargs):
-    """Return the ISO8601-formatted UTC representation of a datetime object."""
-    if localtime and datetime.tzinfo is not None:
-        localized = datetime
-    else:
-        if datetime.tzinfo is None:
-            localized = UTC.localize(datetime)
-        else:
-            localized = datetime.astimezone(UTC)
-    return localized.isoformat(*args, **kwargs)
+def isoformat(datetime):
+    """Return the ISO8601-formatted representation of a datetime object.
+
+    :param datetime datetime: The datetime.
+    """
+    return datetime.isoformat()
 
 
-def to_iso_date(date, *args, **kwargs):
+def to_iso_date(date):
     return dt.date.isoformat(date)
 
 

DateTime timezone management rework
There are various issues I'd like to address in `DateTime` timezone management.

- ~Different behaviour depending on whether dateutil is installed (https://github.com/marshmallow-code/marshmallow/issues/497). Explicit would be better than implicit.~ (Fixed in #1265)
- Awareness not enforced (https://github.com/marshmallow-code/marshmallow/issues/520).

I begun work on this in #933 a while ago but I never got this through. I'd like to come up with a good design before getting back to it.

----------------------------------------------------------------------------------------

~AFAIU, the only action for which dateutil is required is deserializing iso formatted aware datetimes with non-utc timezones.~ Nope. dateutil is never needed (See below and #1265).

~Only iso requires dateutil. rfc format has timezones (https://tools.ietf.org/html/rfc822) but those are not as complex as iso timezones so they don't need dateutil.~ We don't use dateutil for RFC datetimes anymore (https://github.com/marshmallow-code/marshmallow/pull/1246 and https://github.com/marshmallow-code/marshmallow/pull/1248).

----------------------------------------------------------------------------------------

I've been thinking of using two field classes: `NaiveDateTime` and `AwareDateTime`.

Here's what they could do when deserializing:

Input | `NaiveDateTime` | `AwareDateTime`
-- | - | -
Naive | Pass | Fail
Aware UTC | Fail | Pass
Aware non UTC | Fail | Pass unless `utc_only` is `True`

We could add a `utc_only` flag to `AwareDateTime`. An exception would be raised at instantiation time if it is `False` and dateutil is not installed. (This may not be at import time if fields are declared programmatically, but it is better than deserialization time.) `utc_only` would default to `False`. Basically, this means the user who do not want to install dateutil would have to opt-in for `utc_only`. If it's too much pain, he could subclass the field to avoid providing the parameter on each instance.

----------------------------------------------------------------------------------------

There may be other aspects to consider:

- Could `NaiveDateTime` accept an aware datetime? Should it drop the TZ? I don't think so. Should it convert it to a specified TZ before dropping the TZ? It could accept a `timezone` argument specifying a target tz. An exception would be raised if target TZ is not UTC and dateutil is not installed.

`timezone` | Deserialization of aware datetimes in `NaiveDateTime`
-- | -
`None` | Fail
`'UTC'` | Convert to UTC then drop TZ
Some other TZ | Convert to UTC then drop TZ, raise at init if format is iso and no dateutil

- Could `AwareDateTime` accept a naive datetime? It could consider UTC by default. Or we could add a `default_tz` argument.

`default_tz` | Deserialization of naive datetimes in `AwareDateTime`
-- | -
`None` | Fail
`'UTC'` | Add UTC TZ
Some other TZ | Add TZ, raise at init if format is iso and no dateutil

Should this argument be used upon serialization as well? (We could also have `default_tz` and `missing_tz` for serialization/deserialization, copied on the `default`/`missing` logic, but I'd rather avoid this kind of complexity.)

- Could `AwareDateTime` provide a TZ conversion feature? We could add a `convert_to_tz` argument to specify a TZ to convert to (and raise if TZ not UTC and no dateutil)?

`convert_to_tz` | Post-deserialization of datetimes in `AwareDateTime`
-- | -
`None` | Keep TZ
`'UTC'` | Convert to UTC TZ
Some other TZ | Convert to TZ, raise at init if format is iso and no dateutil

Should this argument be used upon serialization as well? I'd say no. But maybe there's a use case for this. AFAIU, the point of `LocalDateTime` is to keep datetime TZ on serialization while `DateTime` converts to UTC implicitly.

- Should we keep `DateTime` as an alias? To which field and with which options?


diff --git a/tests/base.py b/tests/base.py
index 4c3a9466..e502a28e 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -19,7 +19,6 @@ ALL_FIELDS = [
     fields.Float,
     fields.Number,
     fields.DateTime,
-    fields.LocalDateTime,
     fields.Time,
     fields.Date,
     fields.TimeDelta,
@@ -39,14 +38,6 @@ def assert_date_equal(d1, d2):
     assert d1.day == d2.day
 
 
-def assert_datetime_equal(dt1, dt2):
-    assert_date_equal(dt1, dt2)
-    assert dt1.hour == dt2.hour
-    assert dt1.minute == dt2.minute
-    assert dt1.second == dt2.second
-    assert dt1.microsecond == dt2.microsecond
-
-
 def assert_time_equal(t1, t2):
     assert t1.hour == t2.hour
     assert t1.minute == t2.minute
@@ -163,7 +154,6 @@ class UserSchema(Schema):
     )
     created_iso = fields.DateTime(format="iso", attribute="created", dump_only=True)
     updated = fields.DateTime()
-    updated_local = fields.LocalDateTime(attribute="updated", dump_only=True)
     species = fields.String(attribute="SPECIES")
     id = fields.String(default="no-id")
     uppername = Uppercased(attribute="name", dump_only=True)
@@ -211,7 +201,6 @@ class UserMetaSchema(Schema):
     balance = fields.Decimal()
     is_old = fields.Method("get_is_old")
     lowername = fields.Function(get_lowername)
-    updated_local = fields.LocalDateTime(attribute="updated", dump_only=True)
     species = fields.String(attribute="SPECIES")
     homepage = fields.Url()
     email = fields.Email()
@@ -242,7 +231,6 @@ class UserMetaSchema(Schema):
             "balance",
             "is_old",
             "lowername",
-            "updated_local",
             "species",
             "registered",
             "hair_colors",
diff --git a/tests/test_deserialization.py b/tests/test_deserialization.py
index e9264e64..3caad6b4 100644
--- a/tests/test_deserialization.py
+++ b/tests/test_deserialization.py
@@ -9,13 +9,7 @@ from marshmallow import EXCLUDE, INCLUDE, RAISE, fields, utils, Schema, validate
 from marshmallow.exceptions import ValidationError
 from marshmallow.validate import Equal
 
-from tests.base import (
-    assert_date_equal,
-    assert_datetime_equal,
-    assert_time_equal,
-    central,
-    ALL_FIELDS,
-)
+from tests.base import assert_date_equal, assert_time_equal, central, ALL_FIELDS
 
 
 class TestDeserializingNone:
@@ -399,6 +393,7 @@ class TestFieldDeserialization:
             42,
             "",
             [],
+            "2018",
             "2018-01-01",
             dt.datetime.now().strftime("%H:%M:%S %Y-%m-%d"),
             dt.datetime.now().strftime("%m-%d-%Y %H:%M:%S"),
@@ -409,48 +404,160 @@ class TestFieldDeserialization:
         with pytest.raises(ValidationError, match="Not a valid datetime."):
             field.deserialize(in_value)
 
-    def test_datetime_passed_year_is_invalid(self):
-        field = fields.DateTime()
-        with pytest.raises(ValidationError):
-            field.deserialize("1916")
-
-    def test_datetime_passed_date_is_invalid(self):
-        field = fields.DateTime()
-        with pytest.raises(ValidationError):
-            field.deserialize("2017-04-13")
-
     def test_custom_date_format_datetime_field_deserialization(self):
-        dtime = dt.datetime.now()
-        datestring = dtime.strftime("%H:%M:%S.%f %Y-%m-%d")
+        # Datetime string with format "%H:%M:%S.%f %Y-%m-%d"
+        datestring = "10:11:12.123456 2019-01-02"
 
+        # Deserialization should fail when datestring is not of same format
         field = fields.DateTime(format="%d-%m-%Y %H:%M:%S")
-        # deserialization should fail when datestring is not of same format
         with pytest.raises(ValidationError, match="Not a valid datetime."):
             field.deserialize(datestring)
+
         field = fields.DateTime(format="%H:%M:%S.%f %Y-%m-%d")
-        assert_datetime_equal(field.deserialize(datestring), dtime)
+        assert field.deserialize(datestring) == dt.datetime(
+            2019, 1, 2, 10, 11, 12, 123456
+        )
+
+        field = fields.NaiveDateTime(format="%H:%M:%S.%f %Y-%m-%d")
+        assert field.deserialize(datestring) == dt.datetime(
+            2019, 1, 2, 10, 11, 12, 123456
+        )
+
+        field = fields.AwareDateTime(format="%H:%M:%S.%f %Y-%m-%d")
+        with pytest.raises(ValidationError, match="Not a valid aware datetime."):
+            field.deserialize(datestring)
 
     @pytest.mark.parametrize("fmt", ["rfc", "rfc822"])
-    def test_rfc_datetime_field_deserialization(self, fmt):
-        dtime = dt.datetime.now().replace(microsecond=0)
-        datestring = utils.rfcformat(dtime)
+    @pytest.mark.parametrize(
+        ("value", "expected", "aware"),
+        [
+            (
+                "Sun, 10 Nov 2013 01:23:45 -0000",
+                dt.datetime(2013, 11, 10, 1, 23, 45),
+                False,
+            ),
+            (
+                "Sun, 10 Nov 2013 01:23:45 +0000",
+                utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+                True,
+            ),
+            (
+                "Sun, 10 Nov 2013 01:23:45 -0600",
+                central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+                True,
+            ),
+        ],
+    )
+    def test_rfc_datetime_field_deserialization(self, fmt, value, expected, aware):
         field = fields.DateTime(format=fmt)
-        assert_datetime_equal(field.deserialize(datestring), dtime)
+        assert field.deserialize(value) == expected
+        field = fields.NaiveDateTime(format=fmt)
+        if aware:
+            with pytest.raises(ValidationError, match="Not a valid naive datetime."):
+                field.deserialize(value)
+        else:
+            assert field.deserialize(value) == expected
+        field = fields.AwareDateTime(format=fmt)
+        if not aware:
+            with pytest.raises(ValidationError, match="Not a valid aware datetime."):
+                field.deserialize(value)
+        else:
+            assert field.deserialize(value) == expected
 
     @pytest.mark.parametrize("fmt", ["iso", "iso8601"])
-    def test_iso_datetime_field_deserialization(self, fmt):
-        dtime = dt.datetime.now()
-        datestring = dtime.isoformat()
+    @pytest.mark.parametrize(
+        ("value", "expected", "aware"),
+        [
+            ("2013-11-10T01:23:45", dt.datetime(2013, 11, 10, 1, 23, 45), False),
+            (
+                "2013-11-10T01:23:45+00:00",
+                utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+                True,
+            ),
+            (
+                # Regression test for https://github.com/marshmallow-code/marshmallow/issues/1251
+                "2013-11-10T01:23:45.123+00:00",
+                utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45, 123000)),
+                True,
+            ),
+            (
+                "2013-11-10T01:23:45.123456+00:00",
+                utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45, 123456)),
+                True,
+            ),
+            (
+                "2013-11-10T01:23:45-06:00",
+                central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+                True,
+            ),
+        ],
+    )
+    def test_iso_datetime_field_deserialization(self, fmt, value, expected, aware):
         field = fields.DateTime(format=fmt)
-        assert_datetime_equal(field.deserialize(datestring), dtime)
+        assert field.deserialize(value) == expected
+        field = fields.NaiveDateTime(format=fmt)
+        if aware:
+            with pytest.raises(ValidationError, match="Not a valid naive datetime."):
+                field.deserialize(value)
+        else:
+            assert field.deserialize(value) == expected
+        field = fields.AwareDateTime(format=fmt)
+        if not aware:
+            with pytest.raises(ValidationError, match="Not a valid aware datetime."):
+                field.deserialize(value)
+        else:
+            assert field.deserialize(value) == expected
 
-    def test_localdatetime_field_deserialization(self):
-        dtime = dt.datetime.now()
-        localized_dtime = central.localize(dtime)
-        field = fields.DateTime(format="iso")
-        result = field.deserialize(localized_dtime.isoformat())
-        assert_datetime_equal(result, dtime)
-        assert result.tzinfo is not None
+    @pytest.mark.parametrize(
+        ("fmt", "timezone", "value", "expected"),
+        [
+            ("iso", None, "2013-11-10T01:23:45", dt.datetime(2013, 11, 10, 1, 23, 45)),
+            (
+                "iso",
+                utils.UTC,
+                "2013-11-10T01:23:45+00:00",
+                dt.datetime(2013, 11, 10, 1, 23, 45),
+            ),
+            (
+                "iso",
+                central,
+                "2013-11-10T01:23:45-03:00",
+                dt.datetime(2013, 11, 9, 22, 23, 45),
+            ),
+            (
+                "rfc",
+                None,
+                "Sun, 10 Nov 2013 01:23:45 -0000",
+                dt.datetime(2013, 11, 10, 1, 23, 45),
+            ),
+            (
+                "rfc",
+                utils.UTC,
+                "Sun, 10 Nov 2013 01:23:45 +0000",
+                dt.datetime(2013, 11, 10, 1, 23, 45),
+            ),
+            (
+                "rfc",
+                central,
+                "Sun, 10 Nov 2013 01:23:45 -0300",
+                dt.datetime(2013, 11, 9, 22, 23, 45),
+            ),
+        ],
+    )
+    def test_naive_datetime_with_timezone(self, fmt, timezone, value, expected):
+        field = fields.NaiveDateTime(format=fmt, timezone=timezone)
+        assert field.deserialize(value) == expected
+
+    @pytest.mark.parametrize("timezone", (utils.UTC, central))
+    @pytest.mark.parametrize(
+        ("fmt", "value"),
+        [("iso", "2013-11-10T01:23:45"), ("rfc", "Sun, 10 Nov 2013 01:23:45")],
+    )
+    def test_aware_datetime_default_timezone(self, fmt, timezone, value):
+        field = fields.AwareDateTime(format=fmt, default_timezone=timezone)
+        assert field.deserialize(value) == dt.datetime(
+            2013, 11, 10, 1, 23, 45, tzinfo=timezone
+        )
 
     def test_time_field_deserialization(self):
         field = fields.Time()
diff --git a/tests/test_schema.py b/tests/test_schema.py
index d41a5933..df4e940c 100644
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -569,11 +569,6 @@ def test_tz_datetime_field(user, serialized_user):
     assert serialized_user["updated"] == expected
 
 
-def test_local_datetime_field(user, serialized_user):
-    expected = utils.isoformat(user.updated, localtime=True)
-    assert serialized_user["updated_local"] == expected
-
-
 def test_class_variable(serialized_user):
     assert serialized_user["species"] == "Homo sapiens"
 
@@ -1636,7 +1631,6 @@ def test_meta_serializer_fields():
     assert result["uppername"] == "JOHN"
     assert result["is_old"] is False
     assert result["created"] == utils.isoformat(u.created)
-    assert result["updated_local"] == utils.isoformat(u.updated, localtime=True)
     assert result["finger_count"] == 10
     assert result["various_data"] == dict(u.various_data)
 
@@ -1645,7 +1639,6 @@ def test_meta_fields_mapping(user):
     s = UserMetaSchema()
     s.dump(user)  # need to call dump to update fields
     assert type(s.fields["balance"]) == fields.Decimal
-    assert type(s.fields["updated_local"]) == fields.LocalDateTime
     # Inferred fields
     assert type(s.fields["name"]._field_cache[fields.String]) == fields.String
     assert type(s.fields["created"]._field_cache[fields.DateTime]) == fields.DateTime
diff --git a/tests/test_serialization.py b/tests/test_serialization.py
index 6d24c6d6..c0793b75 100644
--- a/tests/test_serialization.py
+++ b/tests/test_serialization.py
@@ -11,7 +11,7 @@ import pytest
 from marshmallow import Schema, fields, utils, missing as missing_
 from marshmallow.exceptions import ValidationError
 
-from tests.base import User, ALL_FIELDS
+from tests.base import User, ALL_FIELDS, central
 
 
 class DateTimeList:
@@ -498,11 +498,6 @@ class TestFieldSerialization:
             "Years": 999,
         }
 
-    def test_datetime_serializes_to_iso_by_default(self, user):
-        field = fields.DateTime()  # No format specified
-        expected = utils.isoformat(user.created, localtime=False)
-        assert field.serialize("created", user) == expected
-
     @pytest.mark.parametrize("value", ["invalid", [], 24])
     def test_datetime_invalid_serialization(self, value, user):
         field = fields.DateTime()
@@ -515,28 +510,52 @@ class TestFieldSerialization:
         ] == '"{}" cannot be formatted as a datetime.'.format(value)
 
     @pytest.mark.parametrize("fmt", ["rfc", "rfc822"])
-    def test_datetime_field_rfc822(self, fmt, user):
-        field = fields.DateTime(format=fmt)
-        expected = utils.rfcformat(user.created, localtime=False)
-        assert field.serialize("created", user) == expected
-
-    def test_localdatetime_rfc_field(self, user):
-        field = fields.LocalDateTime(format="rfc")
-        expected = utils.rfcformat(user.created, localtime=True)
-        assert field.serialize("created", user) == expected
-
-    @pytest.mark.parametrize("fmt", ["iso", "iso8601"])
-    def test_datetime_iso8601(self, fmt, user):
+    @pytest.mark.parametrize(
+        ("value", "expected"),
+        [
+            (dt.datetime(2013, 11, 10, 1, 23, 45), "Sun, 10 Nov 2013 01:23:45 -0000"),
+            (
+                utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+                "Sun, 10 Nov 2013 01:23:45 +0000",
+            ),
+            (
+                central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+                "Sun, 10 Nov 2013 01:23:45 -0600",
+            ),
+        ],
+    )
+    def test_datetime_field_rfc822(self, fmt, value, expected):
         field = fields.DateTime(format=fmt)
-        expected = utils.isoformat(user.created, localtime=False)
-        assert field.serialize("created", user) == expected
+        assert field.serialize("d", {"d": value}) == expected
 
-    def test_localdatetime_iso(self, user):
-        field = fields.LocalDateTime(format="iso")
-        expected = utils.isoformat(user.created, localtime=True)
-        assert field.serialize("created", user) == expected
+    @pytest.mark.parametrize("fmt", ["iso", "iso8601", None])
+    @pytest.mark.parametrize(
+        ("value", "expected"),
+        [
+            (dt.datetime(2013, 11, 10, 1, 23, 45), "2013-11-10T01:23:45"),
+            (
+                utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45, 123456)),
+                "2013-11-10T01:23:45.123456+00:00",
+            ),
+            (
+                utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+                "2013-11-10T01:23:45+00:00",
+            ),
+            (
+                central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+                "2013-11-10T01:23:45-06:00",
+            ),
+        ],
+    )
+    def test_datetime_field_iso8601(self, fmt, value, expected):
+        if fmt is None:
+            # Test default is ISO
+            field = fields.DateTime()
+        else:
+            field = fields.DateTime(format=fmt)
+        assert field.serialize("d", {"d": value}) == expected
 
-    def test_datetime_format(self, user):
+    def test_datetime_field_format(self, user):
         format = "%Y-%m-%d"
         field = fields.DateTime(format=format)
         assert field.serialize("created", user) == user.created.strftime(format)
@@ -851,7 +870,7 @@ class TestSchemaSerialization:
         data = {"name": "Mick"}
         result = AliasingUserSerializer().dump(data)
         assert result["name"] == "Mick"
-        assert result["birthdate"] == "2017-09-29T00:00:00+00:00"
+        assert result["birthdate"] == "2017-09-29T00:00:00"
 
     def test_serialize_with_missing_param_callable(self):
         class AliasingUserSerializer(Schema):
@@ -861,7 +880,7 @@ class TestSchemaSerialization:
         data = {"name": "Mick"}
         result = AliasingUserSerializer().dump(data)
         assert result["name"] == "Mick"
-        assert result["birthdate"] == "2017-09-29T00:00:00+00:00"
+        assert result["birthdate"] == "2017-09-29T00:00:00"
 
 
 def test_serializing_named_tuple():
diff --git a/tests/test_utils.py b/tests/test_utils.py
index b688d23a..e211b1f6 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -6,12 +6,7 @@ from copy import copy, deepcopy
 import pytest
 
 from marshmallow import utils, fields, Schema
-from tests.base import (
-    assert_datetime_equal,
-    central,
-    assert_time_equal,
-    assert_date_equal,
-)
+from tests.base import central, assert_time_equal, assert_date_equal
 
 
 def test_missing_singleton_copy():
@@ -120,73 +115,93 @@ def test_is_collection():
     assert utils.is_collection({"foo": "bar"}) is False
 
 
-def test_rfcformat_gmt_naive():
-    d = dt.datetime(2013, 11, 10, 1, 23, 45)
-    assert utils.rfcformat(d) == "Sun, 10 Nov 2013 01:23:45 -0000"
-
-
-def test_rfcformat_central():
-    d = central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False)
-    assert utils.rfcformat(d) == "Sun, 10 Nov 2013 07:23:45 -0000"
-
-
-def test_rfcformat_naive_localized():
-    d = dt.datetime(2013, 11, 10, 1, 23, 45)
-    assert utils.rfcformat(d, localtime=True) == "Sun, 10 Nov 2013 01:23:45 +0000"
-
-
-def test_rfcformat_central_localized():
-    d = central.localize(dt.datetime(2013, 11, 10, 8, 23, 45), is_dst=False)
-    assert utils.rfcformat(d, localtime=True) == "Sun, 10 Nov 2013 08:23:45 -0600"
-
-
-def test_isoformat():
-    d = dt.datetime(2013, 11, 10, 1, 23, 45)
-    assert utils.isoformat(d) == "2013-11-10T01:23:45+00:00"
-
-
-def test_isoformat_tzaware():
-    d = central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False)
-    assert utils.isoformat(d) == "2013-11-10T07:23:45+00:00"
+@pytest.mark.parametrize(
+    ("value", "expected"),
+    [
+        (dt.datetime(2013, 11, 10, 1, 23, 45), "Sun, 10 Nov 2013 01:23:45 -0000"),
+        (
+            utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+            "Sun, 10 Nov 2013 01:23:45 +0000",
+        ),
+        (
+            central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+            "Sun, 10 Nov 2013 01:23:45 -0600",
+        ),
+    ],
+)
+def test_rfc_format(value, expected):
+    assert utils.rfcformat(value) == expected
 
 
-def test_isoformat_localtime():
-    d = central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False)
-    assert utils.isoformat(d, localtime=True) == "2013-11-10T01:23:45-06:00"
+@pytest.mark.parametrize(
+    ("value", "expected"),
+    [
+        (dt.datetime(2013, 11, 10, 1, 23, 45), "2013-11-10T01:23:45"),
+        (
+            utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45, 123456)),
+            "2013-11-10T01:23:45.123456+00:00",
+        ),
+        (
+            utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+            "2013-11-10T01:23:45+00:00",
+        ),
+        (
+            central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+            "2013-11-10T01:23:45-06:00",
+        ),
+    ],
+)
+def test_isoformat(value, expected):
+    assert utils.isoformat(value) == expected
 
 
-def test_from_rfc():
-    d = dt.datetime.now().replace(microsecond=0)
-    rfc = utils.rfcformat(d)
-    result = utils.from_rfc(rfc)
+@pytest.mark.parametrize(
+    ("value", "expected"),
+    [
+        ("Sun, 10 Nov 2013 01:23:45 -0000", dt.datetime(2013, 11, 10, 1, 23, 45)),
+        (
+            "Sun, 10 Nov 2013 01:23:45 +0000",
+            utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+        ),
+        (
+            "Sun, 10 Nov 2013 01:23:45 -0600",
+            central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+        ),
+    ],
+)
+def test_from_rfc(value, expected):
+    result = utils.from_rfc(value)
     assert type(result) == dt.datetime
-    assert_datetime_equal(result, d)
+    assert result == expected
 
 
-@pytest.mark.parametrize("timezone", [None, central])
-def test_from_iso_datetime(timezone):
-    d = dt.datetime.now(tz=timezone)
-    formatted = d.isoformat()
-    result = utils.from_iso_datetime(formatted)
-    assert type(result) == dt.datetime
-    assert_datetime_equal(result, d)
-
-    # Test with 3-digit only microseconds
-    #  Regression test for https://github.com/marshmallow-code/marshmallow/issues/1251
-    d = dt.datetime.now(tz=timezone).replace(microsecond=123000)
-    formatted = d.isoformat()
-    formatted = formatted[:23] + formatted[26:]
-    result = utils.from_iso_datetime(formatted)
+@pytest.mark.parametrize(
+    ("value", "expected"),
+    [
+        ("2013-11-10T01:23:45", dt.datetime(2013, 11, 10, 1, 23, 45)),
+        (
+            "2013-11-10T01:23:45+00:00",
+            utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45)),
+        ),
+        (
+            # Regression test for https://github.com/marshmallow-code/marshmallow/issues/1251
+            "2013-11-10T01:23:45.123+00:00",
+            utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45, 123000)),
+        ),
+        (
+            "2013-11-10T01:23:45.123456+00:00",
+            utils.UTC.localize(dt.datetime(2013, 11, 10, 1, 23, 45, 123456)),
+        ),
+        (
+            "2013-11-10T01:23:45-06:00",
+            central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False),
+        ),
+    ],
+)
+def test_from_iso_datetime(value, expected):
+    result = utils.from_iso_datetime(value)
     assert type(result) == dt.datetime
-    assert_datetime_equal(result, d)
-
-
-def test_from_iso_with_tz():
-    d = central.localize(dt.datetime.now())
-    formatted = d.isoformat()
-    result = utils.from_iso_datetime(formatted)
-    assert_datetime_equal(result, d)
-    assert result.tzinfo is not None
+    assert result == expected
 
 
 def test_from_iso_time_with_microseconds():

pip install -e .[dev]
parse_log_pytest
pytest
pytest
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aspy.yaml==1.3.0
attrs==25.3.0
cachetools==5.5.2
cfgv==3.4.0
chardet==5.2.0
colorama==0.4.6
distlib==0.3.9
entrypoints==0.3
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
filelock==3.18.0
flake8==3.7.8
flake8-bugbear==19.3.0
identify==2.6.9
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
-e git+https://github.com/marshmallow-code/marshmallow.git@3142423fba0bfb3bf6690671ff41eef4e811ae25#egg=marshmallow
mccabe==0.6.1
nodeenv==1.9.1
packaging @ file:///croot/packaging_1734472117206/work
platformdirs==4.3.7
pluggy @ file:///croot/pluggy_1733169602837/work
pre-commit==1.21.0
pycodestyle==2.5.0
pyflakes==2.1.1
pyproject-api==1.9.0
pytest @ file:///croot/pytest_1738938843180/work
pytz==2025.2
PyYAML==6.0.2
simplejson==3.20.1
six==1.17.0
toml==0.10.2
tomli==2.2.1
tox==4.25.0
typing_extensions==4.13.0
virtualenv==20.29.3

name: marshmallow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aspy-yaml==1.3.0
      - attrs==25.3.0
      - cachetools==5.5.2
      - cfgv==3.4.0
      - chardet==5.2.0
      - colorama==0.4.6
      - distlib==0.3.9
      - entrypoints==0.3
      - filelock==3.18.0
      - flake8==3.7.8
      - flake8-bugbear==19.3.0
      - identify==2.6.9
      - mccabe==0.6.1
      - nodeenv==1.9.1
      - platformdirs==4.3.7
      - pre-commit==1.21.0
      - pycodestyle==2.5.0
      - pyflakes==2.1.1
      - pyproject-api==1.9.0
      - pytz==2025.2
      - pyyaml==6.0.2
      - simplejson==3.20.1
      - six==1.17.0
      - toml==0.10.2
      - tomli==2.2.1
      - tox==4.25.0
      - typing-extensions==4.13.0
      - virtualenv==20.29.3
prefix: /opt/conda/envs/marshmallow

tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[09:08:05 tests/test_deserialization.py::TestFieldDeserialization::test_custom_date_format_datetime_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_rfc_datetime_field_deserialization[Sun, tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45-expected0-False-iso] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45-expected0-False-iso8601] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45+00:00-expected1-True-iso] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45+00:00-expected1-True-iso8601] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45.123+00:00-expected2-True-iso] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45.123+00:00-expected2-True-iso8601] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45.123456+00:00-expected3-True-iso] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45.123456+00:00-expected3-True-iso8601] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45-06:00-expected4-True-iso] tests/test_deserialization.py::TestFieldDeserialization::test_iso_datetime_field_deserialization[2013-11-10T01:23:45-06:00-expected4-True-iso8601] tests/test_deserialization.py::TestFieldDeserialization::test_naive_datetime_with_timezone[iso-None-2013-11-10T01:23:45-expected0] tests/test_deserialization.py::TestFieldDeserialization::test_naive_datetime_with_timezone[iso-timezone1-2013-11-10T01:23:45+00:00-expected1] tests/test_deserialization.py::TestFieldDeserialization::test_naive_datetime_with_timezone[iso-timezone2-2013-11-10T01:23:45-03:00-expected2] tests/test_deserialization.py::TestFieldDeserialization::test_naive_datetime_with_timezone[rfc-None-Sun, tests/test_deserialization.py::TestFieldDeserialization::test_naive_datetime_with_timezone[rfc-timezone4-Sun, tests/test_deserialization.py::TestFieldDeserialization::test_naive_datetime_with_timezone[rfc-timezone5-Sun, tests/test_deserialization.py::TestFieldDeserialization::test_aware_datetime_default_timezone[iso-2013-11-10T01:23:45-timezone0] tests/test_deserialization.py::TestFieldDeserialization::test_aware_datetime_default_timezone[iso-2013-11-10T01:23:45-timezone1] tests/test_deserialization.py::TestFieldDeserialization::test_aware_datetime_default_timezone[rfc-Sun, tests/test_serialization.py::TestFieldSerialization::test_datetime_field_rfc822[value1-Sun, tests/test_serialization.py::TestFieldSerialization::test_datetime_field_rfc822[value2-Sun, tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value0-2013-11-10T01:23:45-iso] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value0-2013-11-10T01:23:45-iso8601] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value0-2013-11-10T01:23:45-None] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value3-2013-11-10T01:23:45-06:00-iso] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value3-2013-11-10T01:23:45-06:00-iso8601] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value3-2013-11-10T01:23:45-06:00-None] tests/test_serialization.py::TestSchemaSerialization::test_serialize_with_missing_param_value tests/test_serialization.py::TestSchemaSerialization::test_serialize_with_missing_param_callable tests/test_utils.py::test_rfc_format[value1-Sun, tests/test_utils.py::test_rfc_format[value2-Sun, tests/test_utils.py::test_isoformat[value0-2013-11-10T01:23:45] tests/test_utils.py::test_isoformat[value3-2013-11-10T01:23:45-06:00]
tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[String] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Integer] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Boolean] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Float] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Number] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[DateTime] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Time] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Date] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[TimeDelta] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Dict] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Url] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Email] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[UUID] tests/test_deserialization.py::TestDeserializingNone::test_fields_allow_none_deserialize_to_none[Decimal] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[String] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Integer] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Boolean] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Float] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Number] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[DateTime] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Time] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Date] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[TimeDelta] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Dict] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Url] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Email] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[UUID] tests/test_deserialization.py::TestDeserializingNone::test_fields_dont_allow_none_by_default[Decimal] tests/test_deserialization.py::TestDeserializingNone::test_allow_none_is_true_if_missing_is_true tests/test_deserialization.py::TestDeserializingNone::test_list_field_deserialize_none_to_none tests/test_deserialization.py::TestDeserializingNone::test_tuple_field_deserialize_none_to_none tests/test_deserialization.py::TestFieldDeserialization::test_float_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[bad] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_float_field_deserialization[in_val2] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_overflow tests/test_deserialization.py::TestFieldDeserialization::test_integer_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_strict_integer_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_with_places tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_with_places_and_rounding tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_deserialization_string tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_special_values tests/test_deserialization.py::TestFieldDeserialization::test_decimal_field_special_values_not_permitted tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[nan-None] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[nan-False] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[nan-True] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[-nan-None] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[-nan-False] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[-nan-True] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[inf-None] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[inf-False] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[inf-True] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[-inf-None] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[-inf-False] tests/test_deserialization.py::TestFieldDeserialization::test_float_field_allow_nan[-inf-True] tests/test_deserialization.py::TestFieldDeserialization::test_string_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values_invalid[notvalid] tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_truthy_values_invalid[123] tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_empty_truthy tests/test_deserialization.py::TestFieldDeserialization::test_boolean_field_deserialization_with_custom_falsy_values tests/test_deserialization.py::TestFieldDeserialization::test_field_toggle_show_invalid_value_in_error_message tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[not-a-datetime] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[42] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[in_value3] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[2018] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[2018-01-01] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_datetime_deserialization[03-31-2025 tests/test_deserialization.py::TestFieldDeserialization::test_time_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[badvalue] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[in_data2] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_time_field_deserialization[42] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_precision tests/test_deserialization.py::TestFieldDeserialization::test_timedelta_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[badvalue] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[in_value2] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_timedelta_field_deserialization[9999999999] tests/test_deserialization.py::TestFieldDeserialization::test_date_field_deserialization[None] tests/test_deserialization.py::TestFieldDeserialization::test_date_field_deserialization[%Y-%m-%d] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[123] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[in_value2] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_date_field_deserialization[21-08-2014] tests/test_deserialization.py::TestFieldDeserialization::test_dict_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_structured_dict_value_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_structured_dict_key_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_structured_dict_key_value_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_url_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_relative_url_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_url_field_schemes_argument tests/test_deserialization.py::TestFieldDeserialization::test_email_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_function_field_deserialization_is_noop_by_default tests/test_deserialization.py::TestFieldDeserialization::test_function_field_deserialization_with_callable tests/test_deserialization.py::TestFieldDeserialization::test_function_field_deserialization_with_context tests/test_deserialization.py::TestFieldDeserialization::test_function_field_passed_deserialize_only_is_load_only tests/test_deserialization.py::TestFieldDeserialization::test_function_field_passed_deserialize_and_serialize_is_not_load_only tests/test_deserialization.py::TestFieldDeserialization::test_uuid_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[malformed] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[123] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[in_value2] tests/test_deserialization.py::TestFieldDeserialization::test_invalid_uuid_deserialization[tooshort] tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_function_must_be_callable tests/test_deserialization.py::TestFieldDeserialization::test_method_field_deserialization_is_noop_by_default tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_method tests/test_deserialization.py::TestFieldDeserialization::test_deserialization_method_must_be_a_method tests/test_deserialization.py::TestFieldDeserialization::test_method_field_deserialize_only tests/test_deserialization.py::TestFieldDeserialization::test_datetime_list_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_invalid_item tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_multiple_invalid_items tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[notalist] tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[42] tests/test_deserialization.py::TestFieldDeserialization::test_list_field_deserialize_value_that_is_not_a_list[value2] tests/test_deserialization.py::TestFieldDeserialization::test_datetime_int_tuple_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_tuple_field_deserialize_invalid_item tests/test_deserialization.py::TestFieldDeserialization::test_tuple_field_deserialize_multiple_invalid_items tests/test_deserialization.py::TestFieldDeserialization::test_tuple_field_deserialize_value_that_is_not_a_collection[notalist] tests/test_deserialization.py::TestFieldDeserialization::test_tuple_field_deserialize_value_that_is_not_a_collection[42] tests/test_deserialization.py::TestFieldDeserialization::test_tuple_field_deserialize_value_that_is_not_a_collection[value2] tests/test_deserialization.py::TestFieldDeserialization::test_tuple_field_deserialize_invalid_length tests/test_deserialization.py::TestFieldDeserialization::test_constant_field_deserialization tests/test_deserialization.py::TestFieldDeserialization::test_constant_is_always_included_in_deserialized_data tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_function tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_class_that_returns_bool tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validator_that_raises_error_with_list tests/test_deserialization.py::TestFieldDeserialization::test_validator_must_return_false_to_raise_error tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_validator_with_nonascii_input tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_user_validators tests/test_deserialization.py::TestFieldDeserialization::test_field_deserialization_with_custom_error_message tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_to_dict tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_values tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_many tests/test_deserialization.py::TestSchemaDeserialization::test_exclude tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_deserialization_to_dict tests/test_deserialization.py::TestSchemaDeserialization::test_nested_list_deserialization_to_dict tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_none_not_allowed tests/test_deserialization.py::TestSchemaDeserialization::test_nested_many_non_not_allowed tests/test_deserialization.py::TestSchemaDeserialization::test_nested_single_required_missing tests/test_deserialization.py::TestSchemaDeserialization::test_nested_many_required_missing tests/test_deserialization.py::TestSchemaDeserialization::test_nested_only_basestring tests/test_deserialization.py::TestSchemaDeserialization::test_nested_only_basestring_with_list_data tests/test_deserialization.py::TestSchemaDeserialization::test_nested_none_deserialization tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param_symmetry tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param_error_returns_field_name_not_attribute_name tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_attribute_param_error_returns_data_key_not_attribute_name tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_data_key_param tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_dump_only_param tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_value tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_callable tests/test_deserialization.py::TestSchemaDeserialization::test_deserialize_with_missing_param_none tests/test_deserialization.py::TestSchemaDeserialization::test_deserialization_raises_with_errors tests/test_deserialization.py::TestSchemaDeserialization::test_deserialization_raises_with_errors_with_multiple_validators tests/test_deserialization.py::TestSchemaDeserialization::test_deserialization_many_raises_errors tests/test_deserialization.py::TestSchemaDeserialization::test_validation_errors_are_stored tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_a_field tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_an_email_field tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_a_url_field tests/test_deserialization.py::TestSchemaDeserialization::test_required_value_only_passed_to_validators_if_provided tests/test_deserialization.py::TestSchemaDeserialization::test_partial_deserialization[True] tests/test_deserialization.py::TestSchemaDeserialization::test_partial_deserialization[False] tests/test_deserialization.py::TestSchemaDeserialization::test_partial_fields_deserialization tests/test_deserialization.py::TestSchemaDeserialization::test_partial_fields_validation tests/test_deserialization.py::TestSchemaDeserialization::test_unknown_fields_deserialization tests/test_deserialization.py::TestSchemaDeserialization::test_unknown_fields_deserialization_precedence tests/test_deserialization.py::TestSchemaDeserialization::test_unknown_fields_deserialization_with_data_key tests/test_deserialization.py::TestSchemaDeserialization::test_unknown_fields_deserialization_with_index_errors_false tests/test_deserialization.py::TestSchemaDeserialization::test_dump_only_fields_considered_unknown tests/test_deserialization.py::TestValidation::test_integer_with_validator tests/test_deserialization.py::TestValidation::test_integer_with_validators[field0] tests/test_deserialization.py::TestValidation::test_integer_with_validators[field1] tests/test_deserialization.py::TestValidation::test_integer_with_validators[field2] tests/test_deserialization.py::TestValidation::test_float_with_validators[field0] tests/test_deserialization.py::TestValidation::test_float_with_validators[field1] tests/test_deserialization.py::TestValidation::test_float_with_validators[field2] tests/test_deserialization.py::TestValidation::test_string_validator tests/test_deserialization.py::TestValidation::test_function_validator tests/test_deserialization.py::TestValidation::test_function_validators[field0] tests/test_deserialization.py::TestValidation::test_function_validators[field1] tests/test_deserialization.py::TestValidation::test_function_validators[field2] tests/test_deserialization.py::TestValidation::test_method_validator tests/test_deserialization.py::TestValidation::test_nested_data_is_stored_when_validation_fails tests/test_deserialization.py::TestValidation::test_false_value_validation tests/test_deserialization.py::TestValidation::test_nested_partial_load tests/test_deserialization.py::TestValidation::test_deeply_nested_partial_load tests/test_deserialization.py::TestValidation::test_nested_partial_tuple tests/test_deserialization.py::test_required_field_failure[String] tests/test_deserialization.py::test_required_field_failure[Integer] tests/test_deserialization.py::test_required_field_failure[Boolean] tests/test_deserialization.py::test_required_field_failure[Float] tests/test_deserialization.py::test_required_field_failure[Number] tests/test_deserialization.py::test_required_field_failure[DateTime] tests/test_deserialization.py::test_required_field_failure[Time] tests/test_deserialization.py::test_required_field_failure[Date] tests/test_deserialization.py::test_required_field_failure[TimeDelta] tests/test_deserialization.py::test_required_field_failure[Dict] tests/test_deserialization.py::test_required_field_failure[Url] tests/test_deserialization.py::test_required_field_failure[Email] tests/test_deserialization.py::test_required_field_failure[UUID] tests/test_deserialization.py::test_required_field_failure[Decimal] tests/test_deserialization.py::test_required_message_can_be_changed[My tests/test_deserialization.py::test_required_message_can_be_changed[message1] tests/test_deserialization.py::test_required_message_can_be_changed[message2] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[True-exclude] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[True-include] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[True-raise] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[False-exclude] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[False-include] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[False-raise] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[42-exclude] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[42-include] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[42-raise] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[None-exclude] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[None-include] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[None-raise] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[data4-exclude] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[data4-include] tests/test_deserialization.py::test_deserialize_raises_exception_if_input_type_is_incorrect[data4-raise] tests/test_schema.py::test_serializing_basic_object[UserSchema] tests/test_schema.py::test_serializing_basic_object[UserMetaSchema] tests/test_schema.py::test_serializer_dump tests/test_schema.py::test_dump_raises_with_dict_of_errors tests/test_schema.py::test_dump_mode_raises_error[UserSchema] tests/test_schema.py::test_dump_mode_raises_error[UserMetaSchema] tests/test_schema.py::test_dump_resets_errors tests/test_schema.py::test_load_resets_errors tests/test_schema.py::test_load_validation_error_stores_input_data_and_valid_data tests/test_schema.py::test_dump_validation_error_stores_partially_valid_data tests/test_schema.py::test_dump_resets_error_fields tests/test_schema.py::test_load_resets_error_fields tests/test_schema.py::test_errored_fields_do_not_appear_in_output tests/test_schema.py::test_load_many_stores_error_indices tests/test_schema.py::test_dump_many tests/test_schema.py::test_multiple_errors_can_be_stored_for_a_given_index tests/test_schema.py::test_dump_many_stores_error_indices tests/test_schema.py::test_dump_many_doesnt_stores_error_indices_when_index_errors_is_false tests/test_schema.py::test_dump_returns_a_dict tests/test_schema.py::test_dumps_returns_a_string tests/test_schema.py::test_dumping_single_object_with_collection_schema tests/test_schema.py::test_loading_single_object_with_collection_schema tests/test_schema.py::test_dumps_many tests/test_schema.py::test_load_returns_an_object tests/test_schema.py::test_load_many tests/test_schema.py::test_load_invalid_input_type[None] tests/test_schema.py::test_load_invalid_input_type[False] tests/test_schema.py::test_load_invalid_input_type[1] tests/test_schema.py::test_load_invalid_input_type[1.2] tests/test_schema.py::test_load_invalid_input_type[val4] tests/test_schema.py::test_load_invalid_input_type[val5] tests/test_schema.py::test_load_invalid_input_type[val6] tests/test_schema.py::test_load_invalid_input_type[lol] tests/test_schema.py::test_load_many_invalid_input_type[None] tests/test_schema.py::test_load_many_invalid_input_type[False] tests/test_schema.py::test_load_many_invalid_input_type[1] tests/test_schema.py::test_load_many_invalid_input_type[1.2] tests/test_schema.py::test_load_many_invalid_input_type[val4] tests/test_schema.py::test_load_many_invalid_input_type[val5] tests/test_schema.py::test_load_many_invalid_input_type[val6] tests/test_schema.py::test_load_many_invalid_input_type[lol] tests/test_schema.py::test_load_many_empty_collection[val0] tests/test_schema.py::test_load_many_empty_collection[val1] tests/test_schema.py::test_load_many_in_nested_invalid_input_type[False] tests/test_schema.py::test_load_many_in_nested_invalid_input_type[1] tests/test_schema.py::test_load_many_in_nested_invalid_input_type[1.2] tests/test_schema.py::test_load_many_in_nested_invalid_input_type[val3] tests/test_schema.py::test_load_many_in_nested_invalid_input_type[val4] tests/test_schema.py::test_load_many_in_nested_invalid_input_type[val5] tests/test_schema.py::test_load_many_in_nested_invalid_input_type[lol] tests/test_schema.py::test_load_many_in_nested_empty_collection[val0] tests/test_schema.py::test_load_many_in_nested_empty_collection[val1] tests/test_schema.py::test_loads_returns_a_user tests/test_schema.py::test_loads_many tests/test_schema.py::test_loads_deserializes_from_json tests/test_schema.py::test_serializing_none tests/test_schema.py::test_default_many_symmetry tests/test_schema.py::test_on_bind_field_hook tests/test_schema.py::test_nested_on_bind_field_hook tests/test_schema.py::TestValidate::test_validate_raises_with_errors_dict tests/test_schema.py::TestValidate::test_validate_many tests/test_schema.py::TestValidate::test_validate_many_doesnt_store_index_if_index_errors_option_is_false tests/test_schema.py::TestValidate::test_validate tests/test_schema.py::TestValidate::test_validate_required tests/test_schema.py::test_fields_are_not_copies[UserSchema] tests/test_schema.py::test_fields_are_not_copies[UserMetaSchema] tests/test_schema.py::test_dumps_returns_json tests/test_schema.py::test_naive_datetime_field tests/test_schema.py::test_datetime_formatted_field tests/test_schema.py::test_datetime_iso_field tests/test_schema.py::test_tz_datetime_field tests/test_schema.py::test_class_variable tests/test_schema.py::test_serialize_many[UserSchema] tests/test_schema.py::test_serialize_many[UserMetaSchema] tests/test_schema.py::test_inheriting_schema tests/test_schema.py::test_custom_field tests/test_schema.py::test_url_field tests/test_schema.py::test_relative_url_field tests/test_schema.py::test_stores_invalid_url_error[UserSchema] tests/test_schema.py::test_stores_invalid_url_error[UserMetaSchema] tests/test_schema.py::test_email_field[UserSchema] tests/test_schema.py::test_email_field[UserMetaSchema] tests/test_schema.py::test_stored_invalid_email tests/test_schema.py::test_integer_field tests/test_schema.py::test_as_string tests/test_schema.py::test_method_field[UserSchema] tests/test_schema.py::test_method_field[UserMetaSchema] tests/test_schema.py::test_function_field tests/test_schema.py::test_fields_must_be_declared_as_instances tests/test_schema.py::test_serializing_generator[UserSchema] tests/test_schema.py::test_serializing_generator[UserMetaSchema] tests/test_schema.py::test_serializing_empty_list_returns_empty_list tests/test_schema.py::test_serializing_dict tests/test_schema.py::test_serializing_dict_with_meta_fields tests/test_schema.py::test_exclude_in_init[UserSchema] tests/test_schema.py::test_exclude_in_init[UserMetaSchema] tests/test_schema.py::test_only_in_init[UserSchema] tests/test_schema.py::test_only_in_init[UserMetaSchema] tests/test_schema.py::test_invalid_only_param tests/test_schema.py::test_can_serialize_uuid tests/test_schema.py::test_can_serialize_time tests/test_schema.py::test_invalid_time tests/test_schema.py::test_invalid_date tests/test_schema.py::test_invalid_dict_but_okay tests/test_schema.py::test_json_module_is_deprecated tests/test_schema.py::test_render_module tests/test_schema.py::test_custom_error_message tests/test_schema.py::test_custom_unknown_error_message tests/test_schema.py::test_custom_type_error_message tests/test_schema.py::test_custom_type_error_message_with_many tests/test_schema.py::test_custom_error_messages_with_inheritance tests/test_schema.py::test_load_errors_with_many tests/test_schema.py::test_error_raised_if_fields_option_is_not_list tests/test_schema.py::test_error_raised_if_additional_option_is_not_list tests/test_schema.py::test_nested_custom_set_in_exclude_reusing_schema tests/test_schema.py::test_nested_only tests/test_schema.py::test_nested_only_inheritance tests/test_schema.py::test_nested_only_empty_inheritance tests/test_schema.py::test_nested_exclude tests/test_schema.py::test_nested_exclude_inheritance tests/test_schema.py::test_nested_only_and_exclude tests/test_schema.py::test_nested_only_then_exclude_inheritance tests/test_schema.py::test_nested_exclude_then_only_inheritance tests/test_schema.py::test_nested_exclude_and_only_inheritance tests/test_schema.py::test_meta_nested_exclude tests/test_schema.py::test_nested_custom_set_not_implementing_getitem tests/test_schema.py::test_deeply_nested_only_and_exclude tests/test_schema.py::test_data_key_collision[f1] tests/test_schema.py::test_data_key_collision[f5] tests/test_schema.py::test_data_key_collision[None] tests/test_schema.py::test_attribute_collision[f1] tests/test_schema.py::test_attribute_collision[f5] tests/test_schema.py::test_attribute_collision[None] tests/test_schema.py::TestDeeplyNestedLoadOnly::test_load_only tests/test_schema.py::TestDeeplyNestedLoadOnly::test_dump_only tests/test_schema.py::TestDeeplyNestedListLoadOnly::test_load_only tests/test_schema.py::TestDeeplyNestedListLoadOnly::test_dump_only tests/test_schema.py::test_nested_constructor_only_and_exclude tests/test_schema.py::test_only_and_exclude tests/test_schema.py::test_only_and_exclude_with_fields tests/test_schema.py::test_invalid_only_and_exclude_with_fields tests/test_schema.py::test_only_and_exclude_with_additional tests/test_schema.py::test_invalid_only_and_exclude_with_additional tests/test_schema.py::test_exclude_invalid_attribute tests/test_schema.py::test_only_bounded_by_fields tests/test_schema.py::test_only_bounded_by_additional tests/test_schema.py::test_only_empty tests/test_schema.py::test_only_and_exclude_as_string[only] tests/test_schema.py::test_only_and_exclude_as_string[exclude] tests/test_schema.py::test_nested_with_sets tests/test_schema.py::test_meta_serializer_fields tests/test_schema.py::test_meta_fields_mapping tests/test_schema.py::test_meta_field_not_on_obj_raises_attribute_error tests/test_schema.py::test_exclude_fields tests/test_schema.py::test_fields_option_must_be_list_or_tuple tests/test_schema.py::test_exclude_option_must_be_list_or_tuple tests/test_schema.py::test_datetimeformat_option tests/test_schema.py::test_dateformat_option tests/test_schema.py::test_default_dateformat tests/test_schema.py::test_inherit_meta tests/test_schema.py::test_inherit_meta_override tests/test_schema.py::test_additional tests/test_schema.py::test_cant_set_both_additional_and_fields tests/test_schema.py::test_serializing_none_meta tests/test_schema.py::TestHandleError::test_dump_with_custom_error_handler tests/test_schema.py::TestHandleError::test_load_with_custom_error_handler tests/test_schema.py::TestHandleError::test_load_with_custom_error_handler_and_partially_valid_data tests/test_schema.py::TestHandleError::test_custom_error_handler_with_validates_decorator tests/test_schema.py::TestHandleError::test_custom_error_handler_with_validates_schema_decorator tests/test_schema.py::TestHandleError::test_validate_with_custom_error_handler tests/test_schema.py::TestFieldValidation::test_errors_are_cleared_after_loading_collection tests/test_schema.py::TestFieldValidation::test_raises_error_with_list tests/test_schema.py::TestFieldValidation::test_raises_error_with_dict tests/test_schema.py::TestFieldValidation::test_ignored_if_not_in_only tests/test_schema.py::test_schema_repr tests/test_schema.py::TestNestedSchema::test_nested_many_with_missing_attribute tests/test_schema.py::TestNestedSchema::test_nested_with_attribute_none tests/test_schema.py::TestNestedSchema::test_nested_field_does_not_validate_required tests/test_schema.py::TestNestedSchema::test_nested_none tests/test_schema.py::TestNestedSchema::test_nested tests/test_schema.py::TestNestedSchema::test_nested_many_fields tests/test_schema.py::TestNestedSchema::test_nested_meta_many tests/test_schema.py::TestNestedSchema::test_nested_only tests/test_schema.py::TestNestedSchema::test_exclude tests/test_schema.py::TestNestedSchema::test_list_field tests/test_schema.py::TestNestedSchema::test_nested_load_many tests/test_schema.py::TestNestedSchema::test_nested_errors tests/test_schema.py::TestNestedSchema::test_nested_dump_errors tests/test_schema.py::TestNestedSchema::test_nested_dump tests/test_schema.py::TestNestedSchema::test_nested_method_field tests/test_schema.py::TestNestedSchema::test_nested_function_field tests/test_schema.py::TestNestedSchema::test_invalid_float_field tests/test_schema.py::TestNestedSchema::test_serializer_meta_with_nested_fields tests/test_schema.py::TestNestedSchema::test_serializer_with_nested_meta_fields tests/test_schema.py::TestNestedSchema::test_nested_fields_must_be_passed_a_serializer tests/test_schema.py::TestNestedSchema::test_invalid_type_passed_to_nested_field tests/test_schema.py::TestNestedSchema::test_all_errors_on_many_nested_field_with_validates_decorator tests/test_schema.py::TestNestedSchema::test_dump_validation_error tests/test_schema.py::TestNestedSchema::test_nested_unknown_validation[None] tests/test_schema.py::TestNestedSchema::test_nested_unknown_validation[raise] tests/test_schema.py::TestNestedSchema::test_nested_unknown_validation[include] tests/test_schema.py::TestNestedSchema::test_nested_unknown_validation[exclude] tests/test_schema.py::TestPluckSchema::test_pluck tests/test_schema.py::TestPluckSchema::test_pluck_none tests/test_schema.py::TestPluckSchema::test_pluck_with_data_key tests/test_schema.py::TestSelfReference::test_nesting_schema_within_itself tests/test_schema.py::TestSelfReference::test_nesting_schema_by_passing_class_name tests/test_schema.py::TestSelfReference::test_nesting_within_itself_meta tests/test_schema.py::TestSelfReference::test_nested_self_with_only_param tests/test_schema.py::TestSelfReference::test_multiple_pluck_self_field tests/test_schema.py::TestSelfReference::test_nested_self_many tests/test_schema.py::TestSelfReference::test_nested_self_list tests/test_schema.py::test_serialization_with_required_field tests/test_schema.py::test_deserialization_with_required_field tests/test_schema.py::test_deserialization_with_required_field_and_custom_validator tests/test_schema.py::TestContext::test_context_method tests/test_schema.py::TestContext::test_context_method_function tests/test_schema.py::TestContext::test_function_field_raises_error_when_context_not_available tests/test_schema.py::TestContext::test_function_field_handles_bound_serializer tests/test_schema.py::TestContext::test_fields_context tests/test_schema.py::TestContext::test_nested_fields_inherit_context tests/test_schema.py::TestContext::test_nested_list_fields_inherit_context tests/test_schema.py::TestContext::test_nested_dict_fields_inherit_context tests/test_schema.py::test_serializer_can_specify_nested_object_as_attribute tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_schema_subclass tests/test_schema.py::TestFieldInheritance::test_inherit_fields_from_non_schema_subclass tests/test_schema.py::TestFieldInheritance::test_inheritance_follows_mro tests/test_schema.py::TestGetAttribute::test_get_attribute_is_used tests/test_schema.py::TestGetAttribute::test_get_attribute_with_many tests/test_schema.py::TestRequiredFields::test_required_string_field_missing tests/test_schema.py::TestRequiredFields::test_required_string_field_failure tests/test_schema.py::TestRequiredFields::test_allow_none_param tests/test_schema.py::TestRequiredFields::test_allow_none_custom_message tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_dump_output tests/test_schema.py::TestDefaults::test_none_is_serialized_to_none tests/test_schema.py::TestDefaults::test_default_and_value_missing tests/test_schema.py::TestDefaults::test_loading_none tests/test_schema.py::TestDefaults::test_missing_inputs_are_excluded_from_load_output tests/test_schema.py::TestLoadOnly::test_load_only tests/test_schema.py::TestLoadOnly::test_dump_only tests/test_schema.py::TestLoadOnly::test_url_field_requre_tld_false tests/test_serialization.py::TestFieldSerialization::test_number[42-42.0] tests/test_serialization.py::TestFieldSerialization::test_number[0-0.0] tests/test_serialization.py::TestFieldSerialization::test_number[None-None] tests/test_serialization.py::TestFieldSerialization::test_number_as_string tests/test_serialization.py::TestFieldSerialization::test_number_as_string_passed_none tests/test_serialization.py::TestFieldSerialization::test_function_field_passed_func tests/test_serialization.py::TestFieldSerialization::test_function_field_passed_serialize_only_is_dump_only tests/test_serialization.py::TestFieldSerialization::test_function_field_passed_deserialize_and_serialize_is_not_dump_only tests/test_serialization.py::TestFieldSerialization::test_function_field_passed_serialize tests/test_serialization.py::TestFieldSerialization::test_function_field_does_not_swallow_attribute_error tests/test_serialization.py::TestFieldSerialization::test_function_field_load_only tests/test_serialization.py::TestFieldSerialization::test_function_field_passed_serialize_with_context tests/test_serialization.py::TestFieldSerialization::test_function_field_passed_uncallable_object tests/test_serialization.py::TestFieldSerialization::test_integer_field tests/test_serialization.py::TestFieldSerialization::test_integer_as_string_field tests/test_serialization.py::TestFieldSerialization::test_integer_field_default tests/test_serialization.py::TestFieldSerialization::test_integer_field_default_set_to_none tests/test_serialization.py::TestFieldSerialization::test_uuid_field tests/test_serialization.py::TestFieldSerialization::test_decimal_field tests/test_serialization.py::TestFieldSerialization::test_decimal_field_string tests/test_serialization.py::TestFieldSerialization::test_decimal_field_special_values tests/test_serialization.py::TestFieldSerialization::test_decimal_field_special_values_not_permitted tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[nan-None] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[nan-False] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[nan-True] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[-nan-None] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[-nan-False] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[-nan-True] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[inf-None] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[inf-False] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[inf-True] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[-inf-None] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[-inf-False] tests/test_serialization.py::TestFieldSerialization::test_float_field_allow_nan[-inf-True] tests/test_serialization.py::TestFieldSerialization::test_decimal_field_fixed_point_representation tests/test_serialization.py::TestFieldSerialization::test_boolean_field_serialization tests/test_serialization.py::TestFieldSerialization::test_function_with_uncallable_param tests/test_serialization.py::TestFieldSerialization::test_email_field_serialize_none tests/test_serialization.py::TestFieldSerialization::test_dict_field_serialize_none tests/test_serialization.py::TestFieldSerialization::test_dict_field_invalid_dict_but_okay tests/test_serialization.py::TestFieldSerialization::test_dict_field_serialize tests/test_serialization.py::TestFieldSerialization::test_dict_field_serialize_ordereddict tests/test_serialization.py::TestFieldSerialization::test_structured_dict_value_serialize tests/test_serialization.py::TestFieldSerialization::test_structured_dict_key_serialize tests/test_serialization.py::TestFieldSerialization::test_structured_dict_key_value_serialize tests/test_serialization.py::TestFieldSerialization::test_structured_dict_validates tests/test_serialization.py::TestFieldSerialization::test_url_field_serialize_none tests/test_serialization.py::TestFieldSerialization::test_method_field_with_method_missing tests/test_serialization.py::TestFieldSerialization::test_method_field_passed_serialize_only_is_dump_only tests/test_serialization.py::TestFieldSerialization::test_method_field_passed_deserialize_only_is_load_only tests/test_serialization.py::TestFieldSerialization::test_method_field_with_uncallable_attribute tests/test_serialization.py::TestFieldSerialization::test_method_field_does_not_swallow_attribute_error tests/test_serialization.py::TestFieldSerialization::test_method_with_no_serialize_is_missing tests/test_serialization.py::TestFieldSerialization::test_serialize_with_data_key_param tests/test_serialization.py::TestFieldSerialization::test_serialize_with_attribute_and_data_key_uses_data_key tests/test_serialization.py::TestFieldSerialization::test_datetime_invalid_serialization[invalid] tests/test_serialization.py::TestFieldSerialization::test_datetime_invalid_serialization[value1] tests/test_serialization.py::TestFieldSerialization::test_datetime_invalid_serialization[24] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_rfc822[value0-Sun, tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value1-2013-11-10T01:23:45.123456+00:00-iso] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value1-2013-11-10T01:23:45.123456+00:00-iso8601] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value1-2013-11-10T01:23:45.123456+00:00-None] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value2-2013-11-10T01:23:45+00:00-iso] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value2-2013-11-10T01:23:45+00:00-iso8601] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_iso8601[value2-2013-11-10T01:23:45+00:00-None] tests/test_serialization.py::TestFieldSerialization::test_datetime_field_format tests/test_serialization.py::TestFieldSerialization::test_string_field tests/test_serialization.py::TestFieldSerialization::test_string_field_default_to_empty_string tests/test_serialization.py::TestFieldSerialization::test_time_field tests/test_serialization.py::TestFieldSerialization::test_invalid_time_field_serialization[badvalue] tests/test_serialization.py::TestFieldSerialization::test_invalid_time_field_serialization[] tests/test_serialization.py::TestFieldSerialization::test_invalid_time_field_serialization[in_data2] tests/test_serialization.py::TestFieldSerialization::test_invalid_time_field_serialization[42] tests/test_serialization.py::TestFieldSerialization::test_date_field tests/test_serialization.py::TestFieldSerialization::test_invalid_date_field_serialization[badvalue] tests/test_serialization.py::TestFieldSerialization::test_invalid_date_field_serialization[] tests/test_serialization.py::TestFieldSerialization::test_invalid_date_field_serialization[in_data2] tests/test_serialization.py::TestFieldSerialization::test_invalid_date_field_serialization[42] tests/test_serialization.py::TestFieldSerialization::test_timedelta_field tests/test_serialization.py::TestFieldSerialization::test_datetime_list_field tests/test_serialization.py::TestFieldSerialization::test_list_field_with_error tests/test_serialization.py::TestFieldSerialization::test_datetime_list_serialize_single_value tests/test_serialization.py::TestFieldSerialization::test_list_field_serialize_none_returns_none tests/test_serialization.py::TestFieldSerialization::test_list_field_work_with_generator_single_value tests/test_serialization.py::TestFieldSerialization::test_list_field_work_with_generators_multiple_values tests/test_serialization.py::TestFieldSerialization::test_list_field_work_with_generators_error tests/test_serialization.py::TestFieldSerialization::test_list_field_work_with_generators_empty_generator_returns_none_for_every_non_returning_yield_statement tests/test_serialization.py::TestFieldSerialization::test_list_field_work_with_set tests/test_serialization.py::TestFieldSerialization::test_list_field_work_with_custom_class_with_iterator_protocol tests/test_serialization.py::TestFieldSerialization::test_bad_list_field tests/test_serialization.py::TestFieldSerialization::test_datetime_integer_tuple_field tests/test_serialization.py::TestFieldSerialization::test_tuple_field_with_error[obj0] tests/test_serialization.py::TestFieldSerialization::test_tuple_field_with_error[obj1] tests/test_serialization.py::TestFieldSerialization::test_tuple_field_with_error[obj2] tests/test_serialization.py::TestFieldSerialization::test_tuple_field_serialize_none_returns_none tests/test_serialization.py::TestFieldSerialization::test_bad_tuple_field tests/test_serialization.py::TestFieldSerialization::test_serialize_does_not_apply_validators tests/test_serialization.py::TestFieldSerialization::test_constant_field_serialization tests/test_serialization.py::TestFieldSerialization::test_constant_is_always_included_in_serialized_data tests/test_serialization.py::TestFieldSerialization::test_constant_field_serialize_when_omitted tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[String] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Integer] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Boolean] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Float] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Number] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[DateTime] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Time] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Date] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[TimeDelta] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Dict] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Url] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Email] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[UUID] tests/test_serialization.py::TestFieldSerialization::test_all_fields_serialize_none_to_none[Decimal] tests/test_serialization.py::test_serializing_named_tuple tests/test_serialization.py::test_serializing_named_tuple_with_meta tests/test_serialization.py::test_serializing_slice tests/test_serialization.py::test_nested_field_many_serializing_generator tests/test_utils.py::test_missing_singleton_copy tests/test_utils.py::test_get_value_from_object[obj0] tests/test_utils.py::test_get_value_from_object[obj1] tests/test_utils.py::test_get_value_from_object[obj2] tests/test_utils.py::test_get_value_from_object[obj3] tests/test_utils.py::test_get_value_from_namedtuple_with_default tests/test_utils.py::test_get_value_for_nested_object tests/test_utils.py::test_get_value_from_dict tests/test_utils.py::test_get_value tests/test_utils.py::test_set_value tests/test_utils.py::test_is_keyed_tuple tests/test_utils.py::test_is_collection tests/test_utils.py::test_rfc_format[value0-Sun, tests/test_utils.py::test_isoformat[value1-2013-11-10T01:23:45.123456+00:00] tests/test_utils.py::test_isoformat[value2-2013-11-10T01:23:45+00:00] tests/test_utils.py::test_from_rfc[Sun, tests/test_utils.py::test_from_iso_datetime[2013-11-10T01:23:45-expected0] tests/test_utils.py::test_from_iso_datetime[2013-11-10T01:23:45+00:00-expected1] tests/test_utils.py::test_from_iso_datetime[2013-11-10T01:23:45.123+00:00-expected2] tests/test_utils.py::test_from_iso_datetime[2013-11-10T01:23:45.123456+00:00-expected3] tests/test_utils.py::test_from_iso_datetime[2013-11-10T01:23:45-06:00-expected4] tests/test_utils.py::test_from_iso_time_with_microseconds tests/test_utils.py::test_from_iso_time_without_microseconds tests/test_utils.py::test_from_iso_date tests/test_utils.py::test_get_func_args tests/test_utils.py::test_function_field_using_type_annotation
CHANGELOG.rst src/marshmallow/utils.py docs/upgrading.rst src/marshmallow/fields.py
CHANGELOG.rst src/marshmallow/utils.py docs/upgrading.rst src/marshmallow/fields.py