MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / contains

Function contains

tests/test_class.rs:752–760  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

750
751#[test]
752fn contains() {
753 let gil = Python::acquire_gil();
754 let py = gil.python();
755
756 let c = Contains::create_instance(py).unwrap();
757 py_run!(py, c, "assert 1 in c");
758 py_run!(py, c, "assert -1 not in c");
759 py_run!(py, c, "assert 'wrong type' not in c");
760}
761
762py_class!(class ContainsRef |py| {
763 def __contains__(&self, item: &str) -> PyResult<bool> {

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected