()
| 136 | mod tests { |
| 137 | #[test] |
| 138 | fn test_wrap_pyfunction_forms() { |
| 139 | use crate::types::{PyAnyMethods, PyModule}; |
| 140 | use crate::{Python, wrap_pyfunction}; |
| 141 | |
| 142 | #[crate::pyfunction(crate = "crate")] |
| 143 | fn f() {} |
| 144 | |
| 145 | Python::attach(|py| { |
| 146 | let module = PyModule::new(py, "test_wrap_pyfunction_forms").unwrap(); |
| 147 | |
| 148 | let func = wrap_pyfunction!(f, module.clone()).unwrap(); |
| 149 | func.call0().unwrap(); |
| 150 | |
| 151 | let func = wrap_pyfunction!(f, &module).unwrap(); |
| 152 | func.call0().unwrap(); |
| 153 | |
| 154 | let module_borrowed = module.as_borrowed(); |
| 155 | |
| 156 | let func = wrap_pyfunction!(f, module_borrowed).unwrap(); |
| 157 | func.call0().unwrap(); |
| 158 | |
| 159 | let func = wrap_pyfunction!(f, &module_borrowed).unwrap(); |
| 160 | func.call0().unwrap(); |
| 161 | |
| 162 | let func = wrap_pyfunction!(f, py).unwrap(); |
| 163 | func.call0().unwrap(); |
| 164 | }); |
| 165 | } |
| 166 | } |
nothing calls this directly
no test coverage detected