Skip to content

[Bug] TypeError: unhashable type: 'dict' #4

@Miskler

Description

@Miskler

Affected area(s)

  • core
  • colorize
  • cli
  • sphinx
  • python interface

What did you do?

Обновление библиотеки pytest-jsonschema-snapshot + обновление через merge схем

What happened?

Похоже (теория) оно ругается на dict которыми в сути являются allOf / anyOf/ oneOf. Их содержимое является массивом словарей, а компаратор list ожидает массив строк / чисел.

What did you expect to happen?

Корректное сравнение :/

Logs / screenshots

_____________________________________________________________________________ test_catalog_matrix[tree] ______________________________________________________________________________
tests/endpoints/catalog_tests.py:19: in test_catalog_matrix
    make_test(schemashot, factory(api))
tests/conftest.py:56: in make_test
    schemashot.assert_json_match(data, (call, name))
venv/lib/python3.12/site-packages/pytest_jsonschema_snapshot/core.py:153: in assert_json_match
    real_name, status = self._base_match(data, current_schema, real_name)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
venv/lib/python3.12/site-packages/jsonschema_diff/pypi_interface.py:105: in compare
    self.property.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:99: in compare
    prop.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:99: in compare
    prop.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:121: in compare
    prop.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:99: in compare
    prop.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:121: in compare
    prop.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:99: in compare
    prop.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:99: in compare
    prop.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/property.py:156: in compare
    comparator.compare()
venv/lib/python3.12/site-packages/jsonschema_diff/core/custom_compare/list.py:40: in compare
    sm = difflib.SequenceMatcher(a=self.old_value, b=self.new_value, autojunk=False)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3.12/difflib.py:182: in __init__
    self.set_seqs(a, b)
/usr/lib/python3.12/difflib.py:194: in set_seqs
    self.set_seq2(b)
/usr/lib/python3.12/difflib.py:248: in set_seq2
    self.__chain_b()
/usr/lib/python3.12/difflib.py:281: in __chain_b
    indices = b2j.setdefault(elt, [])
              ^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: unhashable type: 'dict'

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreEngine / core logicpython interfacePublic Python API

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions