Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobacis committed Jul 21, 2024
1 parent 43f44cf commit a2b902e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Add

- Implemented `#[ignore]` attribute to ignore test parameters during fixtures resolution/injection. See [#228](https://github.com/la10736/rstest/issues/228) for details

### Fixed

## [0.21.0] 2024/6/1
Expand Down
24 changes: 24 additions & 0 deletions rstest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,30 @@ pub use rstest_macros::fixture;
/// }
/// ```
///
/// ## Ignoring Arguments
///
/// Sometimes, you may want to inject and use fixtures not managed by rstest
/// (e.g. db connection pools for sqlx tests).
///
/// In these cases, you can use the `#[ignore]` attribute to ignore the additional
/// parameter and let another crate take care of it:
///
/// ```rust, ignore
/// use rstest::*;
/// use sqlx::*;
///
/// #[fixture]
/// fn my_fixture() -> i32 { 42 }
///
/// #[rstest]
/// #[sqlx::test]
/// async fn test_db(my_fixture: i32, #[ignore] pool: PgPool) {
/// assert_eq!(42, injected);
/// // do stuff with the connection pool
/// }
/// ```
///
///
/// ## Trace Input Arguments
///
/// Sometimes can be very helpful to print all test's input arguments. To
Expand Down

0 comments on commit a2b902e

Please sign in to comment.