()
| 50 | |
| 51 | |
| 52 | def test_warning_register(): |
| 53 | assert m.CustomWarning is not None |
| 54 | |
| 55 | with pytest.warns(m.CustomWarning) as excinfo: |
| 56 | warnings.warn("This is warning from Python!", m.CustomWarning, stacklevel=1) |
| 57 | |
| 58 | assert issubclass(excinfo[0].category, DeprecationWarning) |
| 59 | assert str(excinfo[0].message) == "This is warning from Python!" |
| 60 | |
| 61 | |
| 62 | def test_warning_custom(): |