From d2f3c9675ad2fba0ca44675277f559d8eea07759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tin=20Tvrtkovi=C4=87?= Date: Mon, 28 Aug 2023 01:44:26 +0200 Subject: [PATCH] Final tweaks --- HISTORY.md | 2 +- tests/test_preconf.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 23671730..f020277b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -10,7 +10,7 @@ ([#410](https://github.com/python-attrs/cattrs/issues/410) [#411](https://github.com/python-attrs/cattrs/pull/411)) - Introduce the `use_class_methods` strategy. Learn more [here](https://catt.rs/en/latest/strategies.html#using-class-specific-structure-and-unstructure-methods). ([#405](https://github.com/python-attrs/cattrs/pull/405)) -- Implement the _union passthrough_ strategy, enabling much richer union handling for preconfigured converters. [Learn more here](https://catt.rs/en/stable/strategies.html#union-passthrough). +- Implement the `union passthrough` strategy, enabling much richer union handling for preconfigured converters. [Learn more here](https://catt.rs/en/stable/strategies.html#union-passthrough). - The `omit` parameter of {py:func}`cattrs.override` is now of type `bool | None` (from `bool`). `None` is the new default and means to apply default _cattrs_ handling to the attribute, which is to omit the attribute if it's marked as `init=False`, and keep it otherwise. - Fix {py:func}`format_exception() ` parameter working for recursive calls to {py:func}`transform_error `. diff --git a/tests/test_preconf.py b/tests/test_preconf.py index 562852d8..f547e8de 100644 --- a/tests/test_preconf.py +++ b/tests/test_preconf.py @@ -209,7 +209,9 @@ def native_unions( strats[bytes] = binary() if include_datetimes: types.append(datetime) - strats[datetime] = datetimes(max_value=datetime(2038, 1, 1)) + strats[datetime] = datetimes( + min_value=datetime(1970, 1, 1), max_value=datetime(2038, 1, 1) + ) if include_objectids: types.append(ObjectId) strats[ObjectId] = builds(ObjectId)