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

Method test_generics_negative

tests/test_funcs.py:564–577  ·  view source on GitHub ↗

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 """
566 Returns `False` on non-decorated generic classes.
567 """
568 T = TypeVar("T")
569
570 class A(Generic[T]):
571 a: T
572
573 assert not has(A)
574
575 assert not has(A[str])
576 # 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