    def test_extend_applicable_validators(self):
        """
        Extending a validator preserves its notion of applicable validators.
        """

        schema = {
            "$defs": {"test": {"type": "number"}},
            "$ref": "#/$defs/test",
            "maximum": 1,
        }

        draft4 = validators.Draft4Validator(schema)
        self.assertTrue(draft4.is_valid(37))  # as $ref ignores siblings

        Derived = validators.extend(validators.Draft4Validator)
        self.assertTrue(Derived(schema).is_valid(37))
Extending a validator preserves its notion of applicable validators.
jsonschema/tests/test_validators.py