Skip to content

Commit

Permalink
Fix tests for Py38
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed Nov 7, 2023
1 parent 8938e28 commit ff89e48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/sphinx/ug_serialize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ For a :class:`~nutree.typed_tree.TypedTree` the defaults are different::
Using Derived Classes
~~~~~~~~~~~~~~~~~~~~~

Instead of passing a ``mapper`` function, we can also use a derived class::
Instead of passing ``mapper`` functions and args, we can also use a derived class::

class MyTree(TypedTree):
DEFAULT_KEY_MAP = TypedTree.DEFAULT_KEY_MAP | { "type": "t", "name": "n", "age": "a" }
Expand Down
8 changes: 7 additions & 1 deletion tests/test_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,13 @@ def test_serialize_typed_tree_derived(self):
"""Save/load an object tree with clones, using derived custom tree."""

class MyTree(TypedTree):
DEFAULT_KEY_MAP = TypedTree.DEFAULT_KEY_MAP | {
# TODO: when Py38 is dropped:
# DEFAULT_KEY_MAP = TypedTree.DEFAULT_KEY_MAP
# | { "type": "t", "name": "n", "age": "a", }
DEFAULT_KEY_MAP = {
"data_id": "i",
"str": "s",
"kind": "k",
"type": "t",
"name": "n",
"age": "a",
Expand Down

0 comments on commit ff89e48

Please sign in to comment.