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
Not sure how tightly this library is coupled to proptest or proptest_derive, but perhaps related to proptest-rs/proptest#179 it would be great if we could use this with async tests.
The text was updated successfully, but these errors were encountered:
#[test_strategy::proptest] expands to proptest::proptest! { ... }, so if proptest! { } supports async fn, test_strategy will also be able to support async fn.
I have experimentally implemented support for async fn in fd49486.
You can write tests for async fn by adding a dependency on tokio to Cargo.toml and adding async = "tokio" to the argument of #[test_strategy::proptest] as shown below.
[dev-dependencies]
proptest = "1.1.0"tokio = { version = "1.28.1", features = ["rt-multi-thread"] }
test-strategy = { git = "https://github.com/frozenlib/test-strategy.git" }
I am not sure if this is the right way to do it, as block_on will be called repeatedly, but I believe that if we try to do more than this, we will need to support async fn by proptest::proptest!{ }.
Not sure how tightly this library is coupled to proptest or proptest_derive, but perhaps related to proptest-rs/proptest#179 it would be great if we could use this with async tests.
The text was updated successfully, but these errors were encountered: