From d66e67bd5c116eb89dbdf332a5426fc2c4b45d09 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Sun, 24 Aug 2025 19:30:36 +0100 Subject: [PATCH] fix warning leaking out of test in `test_methods` --- tests/test_methods.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_methods.rs b/tests/test_methods.rs index 7fbc1a138b6..64fe36592e0 100644 --- a/tests/test_methods.rs +++ b/tests/test_methods.rs @@ -10,6 +10,8 @@ use pyo3::types::{IntoPyDict, PyDict, PyList, PySet, PyString, PyTuple, PyType}; use pyo3::BoundObject; use pyo3_macros::pyclass; +use crate::test_utils::CatchWarnings; + mod test_utils; #[pyclass] @@ -1288,7 +1290,7 @@ fn test_pymethods_warn() { Python::attach(|py| { let typeobj = py.get_type::(); - let obj = typeobj.call0().unwrap(); + let obj = CatchWarnings::enter(py, |_| typeobj.call0()).unwrap(); // FnType::Fn py_expect_warning!(