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

Method test_these

tests/test_make.py:299–315  ·  tests/test_make.py::TestTransformAttrs.test_these

If these is passed, use it and ignore body and base classes.

(self)

Source from the content-addressed store, hash-verified

297 assert b_a.kw_only is False
298
299 def test_these(self):
300 class="st">"""
301 If these is passed, use it and ignore body and base classes.
302 class="st">"""
303
304 class Base:
305 z = attr.ib()
306
307 class C(Base):
308 y = attr.ib()
309
310 attrs, base_attrs, _ = _transform_attrs(
311 C, {class="st">"x": attr.ib()}, False, ClassProps.KeywordOnly.NO, True, None
312 )
313
314 assert [] == base_attrs
315 assert (simple_attr(class="st">"x"),) == attrs
316
317 def test_these_leave_body(self):
318 class="st">"""

Callers

nothing calls this directly

Calls 2

_transform_attrsFunction · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected