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

Function test_try_borrow_mut_while_borrow

tests/test_sharedref.rs:117–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115
116#[test]
117fn test_try_borrow_mut_while_borrow() {
118 let (gil, owner) = prepare_env();
119 let py = gil.python();
120 let _ref = owner.string(py).borrow();
121 assert!(owner.string(py).try_borrow_mut().is_err());
122}
123
124#[test]
125#[should_panic(expected = "already borrowed")]

Callers

nothing calls this directly

Calls 3

prepare_envFunction · 0.85
pythonMethod · 0.80
borrowMethod · 0.80

Tested by

no test coverage detected