============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-9.0.2, pluggy-1.6.0 -- /usr/bin/python
cachedir: .pytest_cache
metadata: {'Python': '3.10.12', 'Platform': 'Linux-6.8.0-1025-gke-x86_64-with-glibc2.35', 'Packages': {'pytest': '9.0.2', 'pluggy': '1.6.0'}, 'Plugins': {'anyio': '4.12.1', 'metadata': '3.1.1', 'json-report': '1.5.0', 'cov': '7.0.0'}}
rootdir: /workspace/tinydb
configfile: pytest.ini
plugins: anyio-4.12.1, metadata-3.1.1, json-report-1.5.0, cov-7.0.0
collecting ... collected 201 items

tests/test_middlewares.py::test_caching PASSED                           [  0%]
tests/test_middlewares.py::test_caching_read PASSED                      [  0%]
tests/test_middlewares.py::test_caching_write_many PASSED                [  1%]
tests/test_middlewares.py::test_caching_flush PASSED                     [  1%]
tests/test_middlewares.py::test_caching_flush_manually PASSED            [  2%]
tests/test_middlewares.py::test_caching_write PASSED                     [  2%]
tests/test_middlewares.py::test_nested PASSED                            [  3%]
tests/test_middlewares.py::test_caching_json_write PASSED                [  3%]
tests/test_operations.py::test_delete[memory] PASSED                     [  4%]
tests/test_operations.py::test_delete[json] PASSED                       [  4%]
tests/test_operations.py::test_add_int[memory] PASSED                    [  5%]
tests/test_operations.py::test_add_int[json] PASSED                      [  5%]
tests/test_operations.py::test_add_str[memory] PASSED                    [  6%]
tests/test_operations.py::test_add_str[json] PASSED                      [  6%]
tests/test_operations.py::test_subtract[memory] PASSED                   [  7%]
tests/test_operations.py::test_subtract[json] PASSED                     [  7%]
tests/test_operations.py::test_set[memory] PASSED                        [  8%]
tests/test_operations.py::test_set[json] PASSED                          [  8%]
tests/test_operations.py::test_increment[memory] PASSED                  [  9%]
tests/test_operations.py::test_increment[json] PASSED                    [  9%]
tests/test_operations.py::test_decrement[memory] PASSED                  [ 10%]
tests/test_operations.py::test_decrement[json] PASSED                    [ 10%]
tests/test_queries.py::test_no_path PASSED                               [ 11%]
tests/test_queries.py::test_path_exists PASSED                           [ 11%]
tests/test_queries.py::test_path_and PASSED                              [ 12%]
tests/test_queries.py::test_callable_in_path_with_map PASSED             [ 12%]
tests/test_queries.py::test_callable_in_path_with_chain PASSED           [ 13%]
tests/test_queries.py::test_eq PASSED                                    [ 13%]
tests/test_queries.py::test_ne PASSED                                    [ 14%]
tests/test_queries.py::test_lt PASSED                                    [ 14%]
tests/test_queries.py::test_le PASSED                                    [ 15%]
tests/test_queries.py::test_gt PASSED                                    [ 15%]
tests/test_queries.py::test_ge PASSED                                    [ 16%]
tests/test_queries.py::test_or PASSED                                    [ 16%]
tests/test_queries.py::test_and PASSED                                   [ 17%]
tests/test_queries.py::test_not PASSED                                   [ 17%]
tests/test_queries.py::test_has_key PASSED                               [ 18%]
tests/test_queries.py::test_regex PASSED                                 [ 18%]
tests/test_queries.py::test_custom PASSED                                [ 19%]
tests/test_queries.py::test_custom_with_params PASSED                    [ 19%]
tests/test_queries.py::test_any PASSED                                   [ 20%]
tests/test_queries.py::test_all PASSED                                   [ 20%]
tests/test_queries.py::test_has PASSED                                   [ 21%]
tests/test_queries.py::test_one_of PASSED                                [ 21%]
tests/test_queries.py::test_hash PASSED                                  [ 22%]
tests/test_queries.py::test_orm_usage PASSED                             [ 22%]
tests/test_queries.py::test_repr PASSED                                  [ 23%]
tests/test_queries.py::test_subclass PASSED                              [ 23%]
tests/test_queries.py::test_noop PASSED                                  [ 24%]
tests/test_queries.py::test_equality PASSED                              [ 24%]
tests/test_queries.py::test_empty_query_error PASSED                     [ 25%]
tests/test_queries.py::test_fragment PASSED                              [ 25%]
tests/test_queries.py::test_fragment_with_path PASSED                    [ 26%]
tests/test_queries.py::test_get_item PASSED                              [ 26%]
tests/test_storages.py::test_json PASSED                                 [ 27%]
tests/test_storages.py::test_json_kwargs PASSED                          [ 27%]
tests/test_storages.py::test_json_readwrite PASSED                       [ 28%]
tests/test_storages.py::test_json_read PASSED                            [ 28%]
tests/test_storages.py::test_create_dirs PASSED                          [ 29%]
tests/test_storages.py::test_json_invalid_directory PASSED               [ 29%]
tests/test_storages.py::test_in_memory PASSED                            [ 30%]
tests/test_storages.py::test_in_memory_close PASSED                      [ 30%]
tests/test_storages.py::test_custom PASSED                               [ 31%]
tests/test_storages.py::test_read_once PASSED                            [ 31%]
tests/test_storages.py::test_custom_with_exception PASSED                [ 32%]
tests/test_storages.py::test_yaml PASSED                                 [ 32%]
tests/test_storages.py::test_encoding FAILED                             [ 33%]
tests/test_tables.py::test_next_id[memory] PASSED                        [ 33%]
tests/test_tables.py::test_next_id[json] PASSED                          [ 34%]
tests/test_tables.py::test_tables_list[memory] PASSED                    [ 34%]
tests/test_tables.py::test_tables_list[json] PASSED                      [ 35%]
tests/test_tables.py::test_one_table[memory] PASSED                      [ 35%]
tests/test_tables.py::test_one_table[json] PASSED                        [ 36%]
tests/test_tables.py::test_multiple_tables[memory] PASSED                [ 36%]
tests/test_tables.py::test_multiple_tables[json] PASSED                  [ 37%]
tests/test_tables.py::test_caching[memory] PASSED                        [ 37%]
tests/test_tables.py::test_caching[json] PASSED                          [ 38%]
tests/test_tables.py::test_query_cache[memory] PASSED                    [ 38%]
tests/test_tables.py::test_query_cache[json] PASSED                      [ 39%]
tests/test_tables.py::test_query_cache_with_mutable_callable[memory] FAILED [ 39%]
tests/test_tables.py::test_query_cache_with_mutable_callable[json] FAILED [ 40%]
tests/test_tables.py::test_zero_cache_size[memory] PASSED                [ 40%]
tests/test_tables.py::test_zero_cache_size[json] PASSED                  [ 41%]
tests/test_tables.py::test_query_cache_size[memory] PASSED               [ 41%]
tests/test_tables.py::test_query_cache_size[json] PASSED                 [ 42%]
tests/test_tables.py::test_lru_cache[memory] PASSED                      [ 42%]
tests/test_tables.py::test_lru_cache[json] PASSED                        [ 43%]
tests/test_tables.py::test_table_is_iterable[memory] PASSED              [ 43%]
tests/test_tables.py::test_table_is_iterable[json] PASSED                [ 44%]
tests/test_tables.py::test_table_name[memory] PASSED                     [ 44%]
tests/test_tables.py::test_table_name[json] PASSED                       [ 45%]
tests/test_tables.py::test_table_repr[memory] PASSED                     [ 45%]
tests/test_tables.py::test_table_repr[json] PASSED                       [ 46%]
tests/test_tables.py::test_truncate_table[memory] PASSED                 [ 46%]
tests/test_tables.py::test_truncate_table[json] PASSED                   [ 47%]
tests/test_tinydb.py::test_drop_tables[memory] PASSED                    [ 47%]
tests/test_tinydb.py::test_drop_tables[json] PASSED                      [ 48%]
tests/test_tinydb.py::test_all[memory] PASSED                            [ 48%]
tests/test_tinydb.py::test_all[json] PASSED                              [ 49%]
tests/test_tinydb.py::test_insert[memory] PASSED                         [ 49%]
tests/test_tinydb.py::test_insert[json] PASSED                           [ 50%]
tests/test_tinydb.py::test_insert_ids[memory] PASSED                     [ 50%]
tests/test_tinydb.py::test_insert_ids[json] PASSED                       [ 51%]
tests/test_tinydb.py::test_insert_with_doc_id[memory] PASSED             [ 51%]
tests/test_tinydb.py::test_insert_with_doc_id[json] PASSED               [ 52%]
tests/test_tinydb.py::test_insert_with_duplicate_doc_id[memory] PASSED   [ 52%]
tests/test_tinydb.py::test_insert_with_duplicate_doc_id[json] PASSED     [ 53%]
tests/test_tinydb.py::test_insert_multiple[memory] PASSED                [ 53%]
tests/test_tinydb.py::test_insert_multiple[json] PASSED                  [ 54%]
tests/test_tinydb.py::test_insert_multiple_with_ids[memory] PASSED       [ 54%]
tests/test_tinydb.py::test_insert_multiple_with_ids[json] PASSED         [ 55%]
tests/test_tinydb.py::test_insert_multiple_with_doc_ids[memory] PASSED   [ 55%]
tests/test_tinydb.py::test_insert_multiple_with_doc_ids[json] PASSED     [ 56%]
tests/test_tinydb.py::test_insert_invalid_type_raises_error[memory] PASSED [ 56%]
tests/test_tinydb.py::test_insert_invalid_type_raises_error[json] PASSED [ 57%]
tests/test_tinydb.py::test_insert_valid_mapping_type[memory] PASSED      [ 57%]
tests/test_tinydb.py::test_insert_valid_mapping_type[json] FAILED        [ 58%]
tests/test_tinydb.py::test_custom_mapping_type_with_json FAILED          [ 58%]
tests/test_tinydb.py::test_remove[memory] PASSED                         [ 59%]
tests/test_tinydb.py::test_remove[json] PASSED                           [ 59%]
tests/test_tinydb.py::test_remove_all_fails[memory] PASSED               [ 60%]
tests/test_tinydb.py::test_remove_all_fails[json] PASSED                 [ 60%]
tests/test_tinydb.py::test_remove_multiple[memory] PASSED                [ 61%]
tests/test_tinydb.py::test_remove_multiple[json] PASSED                  [ 61%]
tests/test_tinydb.py::test_remove_ids[memory] PASSED                     [ 62%]
tests/test_tinydb.py::test_remove_ids[json] PASSED                       [ 62%]
tests/test_tinydb.py::test_remove_returns_ids[memory] PASSED             [ 63%]
tests/test_tinydb.py::test_remove_returns_ids[json] PASSED               [ 63%]
tests/test_tinydb.py::test_update[memory] PASSED                         [ 64%]
tests/test_tinydb.py::test_update[json] PASSED                           [ 64%]
tests/test_tinydb.py::test_update_all[memory] PASSED                     [ 65%]
tests/test_tinydb.py::test_update_all[json] PASSED                       [ 65%]
tests/test_tinydb.py::test_update_returns_ids[memory] PASSED             [ 66%]
tests/test_tinydb.py::test_update_returns_ids[json] PASSED               [ 66%]
tests/test_tinydb.py::test_update_transform[memory] PASSED               [ 67%]
tests/test_tinydb.py::test_update_transform[json] PASSED                 [ 67%]
tests/test_tinydb.py::test_update_ids[memory] PASSED                     [ 68%]
tests/test_tinydb.py::test_update_ids[json] PASSED                       [ 68%]
tests/test_tinydb.py::test_update_multiple[memory] PASSED                [ 69%]
tests/test_tinydb.py::test_update_multiple[json] PASSED                  [ 69%]
tests/test_tinydb.py::test_update_multiple_operation[memory] PASSED      [ 70%]
tests/test_tinydb.py::test_update_multiple_operation[json] PASSED        [ 70%]
tests/test_tinydb.py::test_upsert[memory] PASSED                         [ 71%]
tests/test_tinydb.py::test_upsert[json] PASSED                           [ 71%]
tests/test_tinydb.py::test_upsert_by_id[memory] PASSED                   [ 72%]
tests/test_tinydb.py::test_upsert_by_id[json] PASSED                     [ 72%]
tests/test_tinydb.py::test_search[memory] PASSED                         [ 73%]
tests/test_tinydb.py::test_search[json] PASSED                           [ 73%]
tests/test_tinydb.py::test_search_path[memory] PASSED                    [ 74%]
tests/test_tinydb.py::test_search_path[json] PASSED                      [ 74%]
tests/test_tinydb.py::test_search_no_results_cache[memory] PASSED        [ 75%]
tests/test_tinydb.py::test_search_no_results_cache[json] PASSED          [ 75%]
tests/test_tinydb.py::test_get[memory] PASSED                            [ 76%]
tests/test_tinydb.py::test_get[json] PASSED                              [ 76%]
tests/test_tinydb.py::test_get_ids[memory] PASSED                        [ 77%]
tests/test_tinydb.py::test_get_ids[json] PASSED                          [ 77%]
tests/test_tinydb.py::test_get_multiple_ids[memory] PASSED               [ 78%]
tests/test_tinydb.py::test_get_multiple_ids[json] PASSED                 [ 78%]
tests/test_tinydb.py::test_get_invalid[memory] FAILED                    [ 79%]
tests/test_tinydb.py::test_get_invalid[json] FAILED                      [ 79%]
tests/test_tinydb.py::test_count[memory] PASSED                          [ 80%]
tests/test_tinydb.py::test_count[json] PASSED                            [ 80%]
tests/test_tinydb.py::test_contains[memory] PASSED                       [ 81%]
tests/test_tinydb.py::test_contains[json] PASSED                         [ 81%]
tests/test_tinydb.py::test_contains_ids[memory] PASSED                   [ 82%]
tests/test_tinydb.py::test_contains_ids[json] PASSED                     [ 82%]
tests/test_tinydb.py::test_contains_invalid[memory] FAILED               [ 83%]
tests/test_tinydb.py::test_contains_invalid[json] FAILED                 [ 83%]
tests/test_tinydb.py::test_get_idempotent[memory] PASSED                 [ 84%]
tests/test_tinydb.py::test_get_idempotent[json] PASSED                   [ 84%]
tests/test_tinydb.py::test_multiple_dbs PASSED                           [ 85%]
tests/test_tinydb.py::test_storage_closed_once PASSED                    [ 85%]
tests/test_tinydb.py::test_unique_ids PASSED                             [ 86%]
tests/test_tinydb.py::test_lastid_after_open PASSED                      [ 86%]
tests/test_tinydb.py::test_doc_ids_json PASSED                           [ 87%]
tests/test_tinydb.py::test_insert_string PASSED                          [ 87%]
tests/test_tinydb.py::test_insert_invalid_dict FAILED                    [ 88%]
tests/test_tinydb.py::test_gc PASSED                                     [ 88%]
tests/test_tinydb.py::test_drop_table PASSED                             [ 89%]
tests/test_tinydb.py::test_empty_write PASSED                            [ 89%]
tests/test_tinydb.py::test_query_cache PASSED                            [ 90%]
tests/test_tinydb.py::test_tinydb_is_iterable[memory] PASSED             [ 90%]
tests/test_tinydb.py::test_tinydb_is_iterable[json] PASSED               [ 91%]
tests/test_tinydb.py::test_repr PASSED                                   [ 91%]
tests/test_tinydb.py::test_delete PASSED                                 [ 92%]
tests/test_tinydb.py::test_insert_multiple_with_single_dict[memory] PASSED [ 92%]
tests/test_tinydb.py::test_insert_multiple_with_single_dict[json] PASSED [ 93%]
tests/test_tinydb.py::test_access_storage PASSED                         [ 93%]
tests/test_tinydb.py::test_empty_db_len PASSED                           [ 94%]
tests/test_tinydb.py::test_insert_on_existing_db PASSED                  [ 94%]
tests/test_tinydb.py::test_storage_access PASSED                         [ 95%]
tests/test_tinydb.py::test_lambda_query PASSED                           [ 95%]
tests/test_utils.py::test_lru_cache PASSED                               [ 96%]
tests/test_utils.py::test_lru_cache_set_multiple PASSED                  [ 96%]
tests/test_utils.py::test_lru_cache_get PASSED                           [ 97%]
tests/test_utils.py::test_lru_cache_delete PASSED                        [ 97%]
tests/test_utils.py::test_lru_cache_clear PASSED                         [ 98%]
tests/test_utils.py::test_lru_cache_unlimited PASSED                     [ 98%]
tests/test_utils.py::test_lru_cache_unlimited_explicit PASSED            [ 99%]
tests/test_utils.py::test_lru_cache_iteration_works PASSED               [ 99%]
tests/test_utils.py::test_freeze PASSED                                  [100%]

=================================== FAILURES ===================================
________________________________ test_encoding _________________________________

tmpdir = local('/tmp/pytest-of-openhands/pytest-20/test_encoding0')

    def test_encoding(tmpdir):
        japanese_doc = {"Test": u"こんにちは世界"}
    
        path = str(tmpdir.join('test.db'))
        # cp936 is used for japanese encodings
        jap_storage = JSONStorage(path, encoding="cp936")
        jap_storage.write(japanese_doc)
    
        try:
            exception = json.decoder.JSONDecodeError
        except AttributeError:
            exception = ValueError
    
>       with pytest.raises(exception):
E       Failed: DID NOT RAISE <class 'json.decoder.JSONDecodeError'>

tests/test_storages.py:275: Failed
________________ test_query_cache_with_mutable_callable[memory] ________________

db = <TinyDB tables=['_default', 'table'], tables_count=2, default_table_documents_count=3, all_tables_documents_count=['_default=3', 'table=1']>

    def test_query_cache_with_mutable_callable(db):
        table = db.table('table')
        table.insert({'val': 5})
    
        mutable = 5
        increase = lambda x: x + mutable
    
        assert where('val').is_cacheable()
        assert not where('val').map(increase).is_cacheable()
>       assert not (where('val').map(increase) == 10).is_cacheable()
E       AssertionError: assert not True
E        +  where True = is_cacheable()
E        +    where is_cacheable = Query() == 10.is_cacheable
E        +      where Query() = map(<function test_query_cache_with_mutable_callable.<locals>.<lambda> at 0x7b7d5599bd90>)
E        +        where map = Query().map
E        +          where Query() = where('val')

tests/test_tables.py:86: AssertionError
_________________ test_query_cache_with_mutable_callable[json] _________________

db = <TinyDB tables=['_default', 'table'], tables_count=2, default_table_documents_count=3, all_tables_documents_count=['_default=3', 'table=1']>

    def test_query_cache_with_mutable_callable(db):
        table = db.table('table')
        table.insert({'val': 5})
    
        mutable = 5
        increase = lambda x: x + mutable
    
        assert where('val').is_cacheable()
        assert not where('val').map(increase).is_cacheable()
>       assert not (where('val').map(increase) == 10).is_cacheable()
E       AssertionError: assert not True
E        +  where True = is_cacheable()
E        +    where is_cacheable = Query() == 10.is_cacheable
E        +      where Query() = map(<function test_query_cache_with_mutable_callable.<locals>.<lambda> at 0x7b7d556fa200>)
E        +        where map = Query().map
E        +          where Query() = where('val')

tests/test_tables.py:86: AssertionError
_____________________ test_insert_valid_mapping_type[json] _____________________

db = <TinyDB tables=[], tables_count=0, default_table_documents_count=0, all_tables_documents_count=[]>

    def test_insert_valid_mapping_type(db: TinyDB):
        class CustomDocument(Mapping):
            def __init__(self, data):
                self.data = data
    
            def __getitem__(self, key):
                return self.data[key]
    
            def __iter__(self):
                return iter(self.data)
    
            def __len__(self):
                return len(self.data)
    
        db.drop_tables()
>       db.insert(CustomDocument({'int': 1, 'char': 'a'}))

tests/test_tinydb.py:146: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tinydb/table.py:120: in insert
    self._update_table(updater)
tinydb/table.py:529: in _update_table
    self._storage.write(data)
tinydb/storages.py:118: in write
    json.dump(data, self._handle, **self.kwargs)
/usr/lib/python3.10/json/__init__.py:179: in dump
    for chunk in iterable:
/usr/lib/python3.10/json/encoder.py:431: in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
/usr/lib/python3.10/json/encoder.py:405: in _iterencode_dict
    yield from chunks
/usr/lib/python3.10/json/encoder.py:405: in _iterencode_dict
    yield from chunks
/usr/lib/python3.10/json/encoder.py:438: in _iterencode
    o = _default(o)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <json.encoder.JSONEncoder object at 0x7b7d56c5e5f0>
o = <tests.test_tinydb.test_insert_valid_mapping_type.<locals>.CustomDocument object at 0x7b7d55736590>

    def default(self, o):
        """Implement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).
    
        For example, to support arbitrary iterators, you could
        implement default like this::
    
            def default(self, o):
                try:
                    iterable = iter(o)
                except TypeError:
                    pass
                else:
                    return list(iterable)
                # Let the base class default method raise the TypeError
                return JSONEncoder.default(self, o)
    
        """
>       raise TypeError(f'Object of type {o.__class__.__name__} '
                        f'is not JSON serializable')
E       TypeError: Object of type CustomDocument is not JSON serializable

/usr/lib/python3.10/json/encoder.py:179: TypeError
______________________ test_custom_mapping_type_with_json ______________________

tmpdir = local('/tmp/pytest-of-openhands/pytest-20/test_custom_mapping_type_with_0')

    def test_custom_mapping_type_with_json(tmpdir):
        class CustomDocument(Mapping):
            def __init__(self, data):
                self.data = data
    
            def __getitem__(self, key):
                return self.data[key]
    
            def __iter__(self):
                return iter(self.data)
    
            def __len__(self):
                return len(self.data)
    
        # Insert
        db = TinyDB(str(tmpdir.join('test.db')))
        db.drop_tables()
>       db.insert(CustomDocument({'int': 1, 'char': 'a'}))

tests/test_tinydb.py:167: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tinydb/table.py:120: in insert
    self._update_table(updater)
tinydb/table.py:529: in _update_table
    self._storage.write(data)
tinydb/storages.py:118: in write
    json.dump(data, self._handle, **self.kwargs)
/usr/lib/python3.10/json/__init__.py:179: in dump
    for chunk in iterable:
/usr/lib/python3.10/json/encoder.py:431: in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
/usr/lib/python3.10/json/encoder.py:405: in _iterencode_dict
    yield from chunks
/usr/lib/python3.10/json/encoder.py:405: in _iterencode_dict
    yield from chunks
/usr/lib/python3.10/json/encoder.py:438: in _iterencode
    o = _default(o)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <json.encoder.JSONEncoder object at 0x7b7d56c5e5f0>
o = <tests.test_tinydb.test_custom_mapping_type_with_json.<locals>.CustomDocument object at 0x7b7d5573abc0>

    def default(self, o):
        """Implement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).
    
        For example, to support arbitrary iterators, you could
        implement default like this::
    
            def default(self, o):
                try:
                    iterable = iter(o)
                except TypeError:
                    pass
                else:
                    return list(iterable)
                # Let the base class default method raise the TypeError
                return JSONEncoder.default(self, o)
    
        """
>       raise TypeError(f'Object of type {o.__class__.__name__} '
                        f'is not JSON serializable')
E       TypeError: Object of type CustomDocument is not JSON serializable

/usr/lib/python3.10/json/encoder.py:179: TypeError
___________________________ test_get_invalid[memory] ___________________________

db = <TinyDB tables=['_default'], tables_count=1, default_table_documents_count=3, all_tables_documents_count=['_default=3']>

    def test_get_invalid(db: TinyDB):
>       with pytest.raises(RuntimeError):
E       Failed: DID NOT RAISE <class 'RuntimeError'>

tests/test_tinydb.py:380: Failed
____________________________ test_get_invalid[json] ____________________________

db = <TinyDB tables=['_default'], tables_count=1, default_table_documents_count=3, all_tables_documents_count=['_default=3']>

    def test_get_invalid(db: TinyDB):
>       with pytest.raises(RuntimeError):
E       Failed: DID NOT RAISE <class 'RuntimeError'>

tests/test_tinydb.py:380: Failed
________________________ test_contains_invalid[memory] _________________________

db = <TinyDB tables=['_default'], tables_count=1, default_table_documents_count=3, all_tables_documents_count=['_default=3']>

    def test_contains_invalid(db: TinyDB):
>       with pytest.raises(RuntimeError):
E       Failed: DID NOT RAISE <class 'RuntimeError'>

tests/test_tinydb.py:401: Failed
_________________________ test_contains_invalid[json] __________________________

db = <TinyDB tables=['_default'], tables_count=1, default_table_documents_count=3, all_tables_documents_count=['_default=3']>

    def test_contains_invalid(db: TinyDB):
>       with pytest.raises(RuntimeError):
E       Failed: DID NOT RAISE <class 'RuntimeError'>

tests/test_tinydb.py:401: Failed
___________________________ test_insert_invalid_dict ___________________________

tmpdir = local('/tmp/pytest-of-openhands/pytest-20/test_insert_invalid_dict0')

    def test_insert_invalid_dict(tmpdir):
        path = str(tmpdir.join('db.json'))
    
        with TinyDB(path) as _db:
            data = [{'int': 1}, {'int': 2}]
            _db.insert_multiple(data)
    
            with pytest.raises(TypeError):
                _db.insert({'int': _db})  # Fails
    
>           assert data == _db.all()
E           AssertionError: assert [{'int': 1}, {'int': 2}] == []
E             
E             Left contains 2 more items, first extra item: {'int': 1}
E             
E             Full diff:
E             - []
E             + [
E             +     {...
E             
E             ...Full output truncated (6 lines hidden), use '-vv' to show

tests/test_tinydb.py:558: AssertionError
--------------------------------- JSON report ----------------------------------
report saved to: report.json
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.10.12-final-0 _______________

Name                    Stmts   Miss Branch BrPart  Cover
---------------------------------------------------------
tinydb/__init__.py          5      0      0      0   100%
tinydb/database.py         53      0     14      1    99%
tinydb/middlewares.py      33      0      6      0   100%
tinydb/mypy_plugin.py      11     11      0      0     0%
tinydb/operations.py       22      0      2      1    96%
tinydb/queries.py         153     12     38      8    90%
tinydb/storages.py         55      2      8      0    97%
tinydb/table.py           206      2     94      2    99%
tinydb/utils.py            68      0     14      0   100%
tinydb/version.py           1      0      0      0   100%
---------------------------------------------------------
TOTAL                     607     27    176     12    95%
=========================== short test summary info ============================
FAILED tests/test_storages.py::test_encoding - Failed: DID NOT RAISE <class '...
FAILED tests/test_tables.py::test_query_cache_with_mutable_callable[memory]
FAILED tests/test_tables.py::test_query_cache_with_mutable_callable[json] - A...
FAILED tests/test_tinydb.py::test_insert_valid_mapping_type[json] - TypeError...
FAILED tests/test_tinydb.py::test_custom_mapping_type_with_json - TypeError: ...
FAILED tests/test_tinydb.py::test_get_invalid[memory] - Failed: DID NOT RAISE...
FAILED tests/test_tinydb.py::test_get_invalid[json] - Failed: DID NOT RAISE <...
FAILED tests/test_tinydb.py::test_contains_invalid[memory] - Failed: DID NOT ...
FAILED tests/test_tinydb.py::test_contains_invalid[json] - Failed: DID NOT RA...
FAILED tests/test_tinydb.py::test_insert_invalid_dict - AssertionError: asser...
======================== 10 failed, 191 passed in 0.76s ========================