Debian Codegraph @

pytests/test_tokio_current_thread_asyncio.rs

raw symbols SCIP
1 mod common;
2 mod tokio_asyncio;
3
4 use pyo3::prelude::*;
5
6 fn main() -> pyo3::PyResult<()> {
7 Python::initialize();
8
9 Python::attach(|py| {
10 let mut builder = tokio::runtime::Builder::new_current_thread();
11 builder.enable_all();
12
13 pyo3_async_runtimes::tokio::init(builder);
14 std::thread::spawn(move || {
15 pyo3_async_runtimes::tokio::get_runtime()
16 .block_on(futures_util::future::pending::<()>());
17 });
18
19 pyo3_async_runtimes::tokio::run(py, pyo3_async_runtimes::testing::main())
20 })
21 }