From fa44faad2510edddf727e1004fb54673ffaa8558 Mon Sep 17 00:00:00 2001 From: seanbreckenridge Date: Fri, 19 Mar 2021 17:21:13 -0700 Subject: [PATCH] check use of _default_encode during fallback --- my/core/serialize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/my/core/serialize.py b/my/core/serialize.py index 93dba36..e910ecc 100644 --- a/my/core/serialize.py +++ b/my/core/serialize.py @@ -126,14 +126,14 @@ def test_serialize_fallback() -> None: # cant use a namedtuple here, since the default json.dump serializer # serializes namedtuples as tuples, which become arrays # just test with an array of mixed objects - X = [5, 5.0] + X = [5, datetime.timedelta(seconds=5.0)] # ignore warnings. depending on test order, # the lru_cache'd warning may have already been sent, # so checking may be nondeterministic? with pytest.warns(None): res = jsn.loads(dumps(X)) - assert res == X + assert res == [5, 5.0]