    def test_ErrorTree_setitem(self):
        """
        As of v4.20.0, setting items on an ErrorTree is deprecated.
        """

        e = exceptions.ValidationError("some error", path=["foo"])
        tree = exceptions.ErrorTree()
        subtree = exceptions.ErrorTree(errors=[e])

        message = "ErrorTree.__setitem__ is "
        with self.assertWarnsRegex(DeprecationWarning, message) as w:
            tree["foo"] = subtree

        self.assertEqual(tree["foo"], subtree)
        self.assertEqual(w.filename, __file__)
As of v4.20.0, setting items on an ErrorTree is deprecated.
jsonschema/tests/test_deprecations.py