{"repo":"la10736/rstest","free":true,"listed":false,"github":"https://github.com/la10736/rstest","clone":"git clone https://github.com/la10736/rstest.git","description":"Fixture-based test framework for Rust","language":"Rust","stars":1578,"topics":["rust","testing","testing-tools","test-framework"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"[![Crate][crate-image]][crate-link] [![Docs][docs-image]][docs-link] [![Status][test-action-image]][test-action-link] [![Apache 2.0 Licensed][license-apache-image]][license-apache-link] [![MIT Licensed][license-mit-image]][license-mit-link] Fixture-based test framework for Rust Introduction rstest uses procedural macros to help you on writing fixtures and table-based tests. To use it, add the following lines to your Cargo.toml file: Features - async-timeout : timeout for async tests (Default enabled) - crate-name : Import rstest package with different name (Default enabled) Fixture The core idea is that you can inject your test dependencies by passing them as test arguments. In the following example, a fixture is defined and then used in two tests, simply providing it as an argument: Parametrize You can also inject values in some other ways. For instance, you can create a set of tests by simply providing the injected values for each case: rstest will generate an independent test for each case. Running cargo test in this case executes five tests: If you need to just providing a bunch of values for which you need to run your test, you can use #[values(list, of, values)] argument attribute: Or create a matrix test by using list of values for some variables that will generate the cartesian product of all the values. Use Parametrize definition in more tests If you need to use a test list for more than one test you can use [ rstest reuse ][reuse-crate-link] crate. With this helper ","default_branch":null,"files":null,"tree":[],"storefront":"/r/la10736","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/la10736/rstest/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}