check use of _default_encode during fallback
This commit is contained in:
parent
7d07b9601a
commit
fa44faad25
1 changed files with 2 additions and 2 deletions
|
@ -126,14 +126,14 @@ def test_serialize_fallback() -> None:
|
||||||
# cant use a namedtuple here, since the default json.dump serializer
|
# cant use a namedtuple here, since the default json.dump serializer
|
||||||
# serializes namedtuples as tuples, which become arrays
|
# serializes namedtuples as tuples, which become arrays
|
||||||
# just test with an array of mixed objects
|
# 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,
|
# ignore warnings. depending on test order,
|
||||||
# the lru_cache'd warning may have already been sent,
|
# the lru_cache'd warning may have already been sent,
|
||||||
# so checking may be nondeterministic?
|
# so checking may be nondeterministic?
|
||||||
with pytest.warns(None):
|
with pytest.warns(None):
|
||||||
res = jsn.loads(dumps(X))
|
res = jsn.loads(dumps(X))
|
||||||
assert res == X
|
assert res == [5, 5.0]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue