You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[fixture]asyncfnclient() -> Client{Client::tracked(app()).await.unwrap()}#[rstest]asyncfnit_can_return_its_ip(#[future]client:Client){let client = client.await;// <------ Do I need to write this for every test? Can I make it a one liner?let resp = client.get("/").dispatch().await;assert_eq!("99.73.227.46", resp.into_string().await.unwrap());}
The text was updated successfully, but these errors were encountered:
I guess that what you want is always a concrete client to use in your tests. What you can do is always block your thread to wait the future is terminated:
The block syntax depend from your runtime ... I've used async-std.
Finally if you need just a client to share in all your tests you can use #[once] for your fixture... but I don't know if this have some sense in your code.
The text was updated successfully, but these errors were encountered: