(py: Python)
| 2 | |
| 3 | #[allow(unused)] |
| 4 | fn test_thread_exit_py(py: Python) -> PyResult<()> { |
| 5 | let m = py.import("sys")?; |
| 6 | m.add(py, "exit_thread", py_fn!(py, exit_thread()))?; |
| 7 | py.run( |
| 8 | " |
| 9 | import sys, threading |
| 10 | # should not abort |
| 11 | threading.Thread(target=sys.exit_thread).start() |
| 12 | ", |
| 13 | None, |
| 14 | None, |
| 15 | )?; |
| 16 | py.allow_threads(|| { |
| 17 | std::thread::sleep(std::time::Duration::from_millis(100)); |
| 18 | }); |
| 19 | Ok(()) |
| 20 | } |
| 21 | |
| 22 | // This test requires Rust 1.40, namely |
| 23 | // https://github.com/rust-lang/rust/pull/65646. |
no test coverage detected