(self)
| 1207 | assert "pytest.warns" not in str(exc) |
| 1208 | |
| 1209 | def test_warn_wrong_warning(self): |
| 1210 | def f(): |
| 1211 | warnings.warn("yo", DeprecationWarning) |
| 1212 | |
| 1213 | failed = False |
| 1214 | with warnings.catch_warnings(): |
| 1215 | warnings.simplefilter("error", DeprecationWarning) |
| 1216 | try: |
| 1217 | # Should raise a DeprecationWarning |
| 1218 | assert_warns(UserWarning, f) |
| 1219 | failed = True |
| 1220 | except DeprecationWarning: |
| 1221 | pass |
| 1222 | |
| 1223 | if failed: |
| 1224 | raise AssertionError("wrong warning caught by assert_warn") |
| 1225 | |
| 1226 | |
| 1227 | class TestAssertAllclose: |
nothing calls this directly
no test coverage detected