()
| 678 | |
| 679 | #[test] |
| 680 | fn test_pyfunction_raw_ident() { |
| 681 | #[pyfunction] |
| 682 | fn r#struct() -> bool { |
| 683 | true |
| 684 | } |
| 685 | |
| 686 | #[pyfunction] |
| 687 | #[pyo3(name = "r#enum")] |
| 688 | fn raw_ident() -> bool { |
| 689 | true |
| 690 | } |
| 691 | |
| 692 | #[pymodule] |
| 693 | fn m(m: &Bound<'_, PyModule>) -> PyResult<()> { |
| 694 | m.add_function(wrap_pyfunction!(r#struct, m)?)?; |
| 695 | m.add_function(wrap_pyfunction!(raw_ident, m)?)?; |
| 696 | Ok(()) |
| 697 | } |
| 698 | |
| 699 | Python::attach(|py| { |
| 700 | let m = pyo3::wrap_pymodule!(m)(py); |
| 701 | py_assert!(py, m, "m.struct()"); |
| 702 | py_assert!(py, m, "m.enum()"); |
| 703 | }) |
| 704 | } |
| 705 | |
| 706 | #[cfg(any(not(Py_LIMITED_API), Py_3_12))] |
| 707 | #[pyclass(extends=PyWarning)] |
nothing calls this directly
no outgoing calls
no test coverage detected