MCPcopy Create free account
hub / github.com/alibaba/zvec / test_readonly_attributes

Method test_readonly_attributes

python/tests/test_params.py:323–332  ·  view source on GitHub ↗
(self, attr)

Source from the content-addressed store, hash-verified

321
322 @pytest.mark.parametrize("attr", ["read_only", "enable_mmap"])
323 def test_readonly_attributes(self, attr):
324 param = CollectionOption()
325 import sys
326
327 if sys.version_info >= (3, 11):
328 match_pattern = r"(can't set attribute|has no setter|readonly attribute)"
329 else:
330 match_pattern = r"can't set attribute"
331 with pytest.raises(AttributeError, match=match_pattern):
332 setattr(param, attr, getattr(param, attr))
333
334
335# ----------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected