test-collector-derive

Crates.iotest-collector-derive
lib.rstest-collector-derive
version0.1.2
sourcesrc
created_at2022-05-28 22:18:31.972698
updated_at2022-06-17 18:34:28.433697
descriptionA derive to be able to mark the tests method, so you can iterate over them
homepage
repositoryhttps://github.com/MIF-0/test-collector/tree/main/test-collector-derive
max_upload_size
id596049
size7,034
(MIF-0)

documentation

https://docs.rs/test-collector-derive

README

test-collector-derive will give you '#[collect_test]' which you can use to collect the tests this lib using inventory. Supposed to be used together with test-collector, but you can use it by its own.

    #[collect_test]
    #[test]
    pub fn sync_test_success() {
        println!("Executed sync!");
        assert_eq!(true, true);
    }

    #[collect_test(async)]
    #[actix_web::test]
    pub async fn async_test_success() {
        let client = reqwest::Client::builder()
            .build()
            .expect("error during client build");
        let response = client.get("http://localhost:9090/").send().await;
        assert!(response.is_ok());
    }
Commit count: 0

cargo fmt