()
| 773 | |
| 774 | #[test] |
| 775 | fn test_pyfunction_multiple_warnings() { |
| 776 | #[pyfunction] |
| 777 | #[pyo3(warn(message = "TPMW: this function raises warning"))] |
| 778 | #[pyo3(warn(message = "TPMW: this function raises FutureWarning", category = PyFutureWarning))] |
| 779 | fn function_with_multiple_warnings() {} |
| 780 | |
| 781 | py_expect_warning_for_fn!( |
| 782 | function_with_multiple_warnings, |
| 783 | f, |
| 784 | [ |
| 785 | ("TPMW: this function raises warning", PyUserWarning), |
| 786 | ("TPMW: this function raises FutureWarning", PyFutureWarning) |
| 787 | ] |
| 788 | ); |
| 789 | |
| 790 | #[cfg(not(Py_LIMITED_API))] |
| 791 | #[pyfunction] |
| 792 | #[pyo3(warn(message = "TPMW: this function raises FutureWarning", category = PyFutureWarning))] |
| 793 | #[pyo3(warn(message = "TPMW: this function raises user-defined warning", category = UserDefinedWarning))] |
| 794 | fn function_with_multiple_custom_warnings() {} |
| 795 | |
| 796 | #[cfg(not(Py_LIMITED_API))] |
| 797 | py_expect_warning_for_fn!( |
| 798 | function_with_multiple_custom_warnings, |
| 799 | f, |
| 800 | [ |
| 801 | ("TPMW: this function raises FutureWarning", PyFutureWarning), |
| 802 | ( |
| 803 | "TPMW: this function raises user-defined warning", |
| 804 | UserDefinedWarning |
| 805 | ) |
| 806 | ] |
| 807 | ); |
| 808 | } |
| 809 | |
| 810 | #[test] |
| 811 | #[cfg(any(not(PyPy), Py_3_12))] |
nothing calls this directly
no outgoing calls
no test coverage detected