(self)
| 809 | "assert_warns does not preserver warnings state") |
| 810 | |
| 811 | def test_context_manager(self): |
| 812 | |
| 813 | before_filters = sys.modules['warnings'].filters[:] |
| 814 | with assert_warns(UserWarning): |
| 815 | warnings.warn("yo") |
| 816 | after_filters = sys.modules['warnings'].filters |
| 817 | |
| 818 | def no_warnings(): |
| 819 | with assert_no_warnings(): |
| 820 | warnings.warn("yo") |
| 821 | |
| 822 | assert_raises(AssertionError, no_warnings) |
| 823 | assert_equal(before_filters, after_filters, |
| 824 | "assert_warns does not preserver warnings state") |
| 825 | |
| 826 | def test_warn_wrong_warning(self): |
| 827 | def f(): |
nothing calls this directly
no test coverage detected