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

Function test_try_borrow_while_borrow_mut

tests/test_sharedref.rs:134–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132
133#[test]
134fn test_try_borrow_while_borrow_mut() {
135 let (gil, owner) = prepare_env();
136 let py = gil.python();
137 let _mut_ref = owner.string(py).borrow_mut();
138 assert!(owner.string(py).try_borrow().is_err());
139}
140
141#[test]
142#[should_panic(expected = "already mutably borrowed")]

Callers

nothing calls this directly

Calls 3

prepare_envFunction · 0.85
pythonMethod · 0.80
borrow_mutMethod · 0.80

Tested by

no test coverage detected