Forwarding input arguments of #[tokio::test] annotated tests #2388
Labels
A-tokio
Area: The main tokio crate
A-tokio-macros
Area: The tokio-macros crate
A-tokio-test
Area: The tokio-test crate
C-feature-accepted
Category: A feature request that has been accepted pending implementation.
C-feature-request
Category: A feature request.
E-help-wanted
Call for participation: Help is requested to fix this issue.
M-macros
Module: macros in the main Tokio crate
Test fixture libraries such as rstest tend to use a proc macro to inject fixtures in tests, based on function parameters of the test function. Example:
Currently, there is an ongoing discussion in
rstest
on how to best integrate with test-suites other than the default Rust#[test]
, in particular those that useasync
, such as#[tokio::test]
.In order to transparently integrate and make the
#[rstest]
and#[tokio::test]
attributes "commutative", the function arguments of a test should simply be forwarded by thetokio::test
proc macro. Currently, adding function arguments to a test triggers a custom error. As far as I know, Rust itself would generate an error like that, even without that part of code.This brings me to my main question: dropping that check would allow tighter cooperation with
rstest
, and I believe with other, future fixture frameworks too. Would Tokio accept a patch, dropping that check, like the oneactix-net
just accepted? As far as I can tell, everything else is already in place.The text was updated successfully, but these errors were encountered: