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

Method test_handler_non_attrs_generic_class

tests/test_make.py:1578–1592  ·  view source on GitHub ↗

Raises `ValueError` if passed a non-*attrs* generic class.

(self)

Source from the content-addressed store, hash-verified

1576 ) == e.value.args[0]
1577
1578 def test_handler_non_attrs_generic_class(self):
1579 """
1580 Raises `ValueError` if passed a non-*attrs* generic class.
1581 """
1582 T = TypeVar("T")
1583
1584 class B(Generic[T]):
1585 pass
1586
1587 with pytest.raises(NotAnAttrsClassError) as e:
1588 fields(B[str])
1589
1590 assert (
1591 f"{B[str]!r} is not an attrs-decorated class."
1592 ) == e.value.args[0]
1593
1594 @given(simple_classes())
1595 def test_fields(self, C):

Callers

nothing calls this directly

Calls 1

fieldsFunction · 0.90

Tested by

no test coverage detected