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

Method test_subclass

tests/test_validators.py:136–142  ·  tests/test_validators.py::TestInstanceOf.test_subclass

Subclasses are accepted too.

(self)

Source from the content-addressed store, hash-verified

134 v(None, simple_attr(class="st">"test"), 42)
135
136 def test_subclass(self):
137 class="st">"""
138 Subclasses are accepted too.
139 class="st">"""
140 v = instance_of(int)
141 class="cm"># yep, bools are a subclass of int :(
142 v(None, simple_attr(class="st">"test"), True)
143
144 def test_fail(self):
145 class="st">"""

Callers

nothing calls this directly

Calls 2

instance_ofFunction · 0.90
simple_attrFunction · 0.85

Tested by

no test coverage detected