MCPcopy
hub / github.com/python-attrs/attrs / test_empty_metadata_singleton

Method test_empty_metadata_singleton

tests/test_make.py:1940–1946  ·  tests/test_make.py::TestMetadata.test_empty_metadata_singleton

All empty metadata attributes share the same empty metadata dict.

(self, list_of_attrs)

Source from the content-addressed store, hash-verified

1938
1939 @given(lists(simple_attrs_without_metadata, min_size=2, max_size=5))
1940 def test_empty_metadata_singleton(self, list_of_attrs):
1941 class="st">"""
1942 All empty metadata attributes share the same empty metadata dict.
1943 class="st">"""
1944 C = make_class(class="st">"C", dict(zip(gen_attr_names(), list_of_attrs)))
1945 for a in fields(C)[1:]:
1946 assert a.metadata is fields(C)[0].metadata
1947
1948 @given(lists(simple_attrs_without_metadata, min_size=2, max_size=5))
1949 def test_empty_countingattr_metadata_independent(self, list_of_attrs):

Callers

nothing calls this directly

Calls 3

make_classFunction · 0.90
fieldsFunction · 0.90
gen_attr_namesFunction · 0.85

Tested by

no test coverage detected