Test ExceptionChainRepr, especially with regard to being hashable.
()
| 211 | |
| 212 | |
| 213 | def test_ExceptionChainRepr(): |
| 214 | """Test ExceptionChainRepr, especially with regard to being hashable.""" |
| 215 | try: |
| 216 | raise ValueError() |
| 217 | except ValueError: |
| 218 | excinfo1 = ExceptionInfo.from_current() |
| 219 | excinfo2 = ExceptionInfo.from_current() |
| 220 | |
| 221 | repr1 = excinfo1.getrepr() |
| 222 | repr2 = excinfo2.getrepr() |
| 223 | assert repr1 != repr2 |
| 224 | |
| 225 | assert isinstance(repr1, ExceptionChainRepr) |
| 226 | assert hash(repr1) != hash(repr2) |
| 227 | assert repr1 is not excinfo1.getrepr() |
nothing calls this directly
no test coverage detected