Skip to content

Commit 04531e4

Browse files
author
Andrew J Westlake
committed
Trying crate = pyo3_asyncio in inventory submit to fix issues with downstream tests
1 parent 53efedb commit 04531e4

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

pyo3-asyncio-macros/src/lib.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,14 @@ pub fn async_std_test(_attr: TokenStream, item: TokenStream) -> TokenStream {
170170
let result = quote! {
171171
#fn_impl
172172

173-
inventory::submit!(pyo3_asyncio::testing::Test {
174-
name: format!("{}::{}", std::module_path!(), stringify!(#name)),
175-
test_fn: &#name
176-
});
173+
pyo3_asyncio::inventory::submit! {
174+
#![crate = pyo3_asyncio] {
175+
pyo3_asyncio::testing::Test {
176+
name: format!("{}::{}", std::module_path!(), stringify!(#name)),
177+
test_fn: &#name
178+
}
179+
}
180+
}
177181
};
178182

179183
result.into()
@@ -248,10 +252,14 @@ pub fn tokio_test(_attr: TokenStream, item: TokenStream) -> TokenStream {
248252
let result = quote! {
249253
#fn_impl
250254

251-
pyo3_asyncio::inventory::submit!(pyo3_asyncio::testing::Test {
252-
name: format!("{}::{}", std::module_path!(), stringify!(#name)),
253-
test_fn: &#name
254-
});
255+
pyo3_asyncio::inventory::submit! {
256+
#![crate = pyo3_asyncio] {
257+
pyo3_asyncio::testing::Test {
258+
name: format!("{}::{}", std::module_path!(), stringify!(#name)),
259+
test_fn: &#name
260+
}
261+
}
262+
}
255263
};
256264

257265
result.into()

0 commit comments

Comments
 (0)