test-context/release-plz.toml
Víctor Martínez 39756352a8
feat: make it so immutable references & full ownership can be taken depending on context (#58)
This pull requests introduces changes that make the use of the `test_context` macro more flexible.

Now, if the teardown is not skipped (default behavior), either an `immutable` or a `mutable` reference can be used for the context.

If the teardown is skipped with the `skip_teardown` option, an `immutable`, a `mutable` reference or full ownership can be taken.

So now the following is possible:

```rust
#[test_context(TeardownPanicContext, skip_teardown)]
#[tokio::test]
async fn test_async_skip_teardown(_ctx: &mut TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[tokio::test]
async fn test_async_skip_teardown_with_immutable_ref(_ctx: &TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[tokio::test]
async fn test_async_skip_teardown_with_full_ownership(_ctx: TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[test]
fn test_sync_skip_teardown(_ctx: &mut TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[test]
fn test_sync_skip_teardown_with_immutable_ref(_ctx: &TeardownPanicContext) {}

#[test_context(TeardownPanicContext, skip_teardown)]
#[test]
fn test_sync_skip_teardown_with_full_ownership(_ctx: TeardownPanicContext) {}
```
2025-11-06 13:52:20 +01:00

7 lines
172 B
TOML

[workspace]
pr_branch_prefix = "release-"
pr_labels = ["release"]
git_tag_enable = true
git_tag_name = "v{{ version }}"
git_release_name = "v{{ version }}"
pr_draft = true