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

Method test_generics_negative

tests/test_funcs.py:564–577  ·  tests/test_funcs.py::TestHas.test_generics_negative

Returns `False` on non-decorated generic classes.

(self)

Source from the content-addressed store, hash-verified

562 assert has(A[str])
563
564 def test_generics_negative(self):
565 class="st">"""
566 Returns `False` on non-decorated generic classes.
567 class="st">"""
568 T = TypeVar(class="st">"T")
569
570 class A(Generic[T]):
571 a: T
572
573 assert not has(A)
574
575 assert not has(A[str])
576 class="cm"># Verify twice, since there's caching going on.
577 assert not has(A[str])
578
579
580class TestAssoc:

Callers

nothing calls this directly

Calls 1

hasFunction · 0.90

Tested by

no test coverage detected