Test ExceptionChainRepr, especially with regard to being hashable.
()
| 196 | |
| 197 | |
| 198 | def test_ExceptionChainRepr(): |
| 199 | """Test ExceptionChainRepr, especially with regard to being hashable.""" |
| 200 | try: |
| 201 | raise ValueError() |
| 202 | except ValueError: |
| 203 | excinfo1 = ExceptionInfo.from_current() |
| 204 | excinfo2 = ExceptionInfo.from_current() |
| 205 | |
| 206 | repr1 = excinfo1.getrepr() |
| 207 | repr2 = excinfo2.getrepr() |
| 208 | assert repr1 != repr2 |
| 209 | |
| 210 | assert isinstance(repr1, ExceptionChainRepr) |
| 211 | assert hash(repr1) != hash(repr2) |
| 212 | assert repr1 is not excinfo1.getrepr() |
nothing calls this directly
no test coverage detected