| Total Complexity | 2 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| 1 | from hamcrest.core.selfdescribing import SelfDescribing |
||
| 10 | class SelfDescribingValue(SelfDescribing): |
||
| 11 | """Wrap any value in a ``SelfDescribingValue`` to satisfy the |
||
| 12 | :py:class:`~hamcrest.core.selfdescribing.SelfDescribing` interface. |
||
| 13 | |||
| 14 | **Deprecated:** No need for this class now that |
||
| 15 | :py:meth:`~hamcrest.core.description.Description.append_description_of` |
||
| 16 | handles any type of value. |
||
| 17 | |||
| 18 | """ |
||
| 19 | |||
| 20 | def __init__(self, value): |
||
| 21 | warnings.warn('SelfDescribingValue no longer needed', |
||
| 22 | DeprecationWarning) |
||
| 23 | self.value = value |
||
| 24 | |||
| 25 | def describe_to(self, description): |
||
| 26 | """Generates a description of the value.""" |
||
| 27 | description.append_value(self.value) |
||
| 28 |