From d33c5010c7f2a8c68f7736ab067902ce7e568e5f Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Thu, 6 May 2021 15:58:45 +0200 Subject: [PATCH] Add test for wrap_pyfunction!() deduction. --- tests/test_wrap_pyfunction_deduction.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/test_wrap_pyfunction_deduction.rs diff --git a/tests/test_wrap_pyfunction_deduction.rs b/tests/test_wrap_pyfunction_deduction.rs new file mode 100644 index 00000000..c561a419 --- /dev/null +++ b/tests/test_wrap_pyfunction_deduction.rs @@ -0,0 +1,13 @@ +use pyo3::{prelude::*, types::PyCFunction, wrap_pyfunction}; + +#[pyfunction] +fn f() {} + +pub fn add_wrapped(wrapper: &impl Fn(Python) -> PyResult<&PyCFunction>) { + let _ = wrapper; +} + +#[test] +fn wrap_pyfunction_deduction() { + add_wrapped(wrap_pyfunction!(f)); +}