Skip to content

Commit

Permalink
Add default timeout docs also on lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
la10736 committed Mar 24, 2023
1 parent 06bc1b5 commit 14315db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -235,9 +235,9 @@ In this case test pass because the delay is just 10 milliseconds and timeout is

You can use `timeout` attribute like any other attibute in your tests and you can
override a group timeout with a case specific one. In the follow example we have
3 tests where first and third use 100 millis but the second one use 10 millis.
3 tests where first and third use 100 millis but the second one use 10 millis.
Another valuable point in this example is to use an expression to compute the
duration.
duration.

```rust
fn ms(ms: u32) -> Duration {
Expand Down
7 changes: 6 additions & 1 deletion rstest_macros/src/lib.rs
Expand Up @@ -753,13 +753,18 @@ pub fn fixture(
/// assert_eq!(expected, base.await / div);
/// }
/// ```
///
/// ### Default timeout
///
/// You can set a default timeout for test using the `RSTEST_TIMEOUT` environment variable.
/// The value is in seconds and is evaluated on test compile time.///
///
/// ### Test `#[timeout()]`
///
/// You can define an execution timeout for your tests with `#[timeout(<duration>)]` attribute. Timeouts
/// works both for sync and async tests and is runtime agnostic. `#[timeout(<duration>)]` take an
/// expression that should return a `std::time::Duration`. Follow a simple async example:
///
///
/// ```rust
/// use rstest::*;
/// use std::time::Duration;
Expand Down

0 comments on commit 14315db

Please sign in to comment.