    def test_newly_created_validator_with_ref_resolver(self):
        """
        See https://github.com/python-jsonschema/jsonschema/issues/1061#issuecomment-1624266555.
        """

        def handle(uri):
            self.assertEqual(uri, "http://example.com/foo")
            return {"type": "integer"}

        resolver = validators._RefResolver("", {}, handlers={"http": handle})
        Validator = validators.create(
            meta_schema={},
            validators=validators.Draft4Validator.VALIDATORS,
        )
        schema = {"$id": "http://example.com/bar", "$ref": "foo"}
        validator = Validator(schema, resolver=resolver)
        self.assertEqual(
            (validator.is_valid({}), validator.is_valid(37)),
            (False, True),
        )
See https://github.com/python-jsonschema/jsonschema/issues/1061#issuecomment-1624266555.
jsonschema/tests/test_validators.py