mirror of
https://codeberg.org/JasterV/test-context.git
synced 2026-04-26 18:10:06 +00:00
Merge pull request #4 from markhildreth/future-dependency
Forced futures to be imported through test_context crate.
This commit is contained in:
commit
5edf65b78e
3 changed files with 5 additions and 2 deletions
|
|
@ -13,10 +13,10 @@ categories = ["development-tools::testing"]
|
|||
[dependencies]
|
||||
test-context-macros = { version = "0.1.1", path = "macros" }
|
||||
async-trait = "0.1.42"
|
||||
futures = "0.3"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.0", features = ["macros", "rt"]}
|
||||
futures = "0.3.12"
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ pub fn test_context(attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||
let outer_body = if is_async {
|
||||
quote! {
|
||||
{
|
||||
use futures::FutureExt;
|
||||
use test_context::futures::FutureExt;
|
||||
let mut ctx = <#context_type as test_context::AsyncTestContext>::setup().await;
|
||||
let wrapped_ctx = &mut ctx;
|
||||
let result = async move {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@
|
|||
//! }
|
||||
//! ```
|
||||
|
||||
// Reimported to allow for use in the macro.
|
||||
pub use futures;
|
||||
|
||||
pub use test_context_macros::test_context;
|
||||
|
||||
/// The trait to implement to get setup/teardown functionality for tests.
|
||||
|
|
|
|||
Loading…
Reference in a new issue