apache-avro-test-helper

Crates.ioapache-avro-test-helper
lib.rsapache-avro-test-helper
version0.17.0
sourcesrc
created_at2022-08-03 18:48:32.849455
updated_at2024-08-05 20:46:33.729598
descriptionApache Avro tests helper.
homepage
repositoryhttps://github.com/apache/avro
max_upload_size
id638265
size28,445
Fokko Driesprong (Fokko)

documentation

https://docs.rs/apache-avro-test-helper

README

Avro Test Helper

A module that provides several test related goodies to the other Avro crates:

Custom Logger

The logger:

  • collects the logged messages, so that a test could assert what has been logged
  • delegates to env_logger so that they printed on the stderr

Colorized Backtraces

Uses color-backtrace to make the backtraces easier to read.

Setup

Unit tests

The module is automatically setup for all unit tests when this crate is listed as a [dev-dependency] in Cargo.toml.

Integration tests

Since integration tests are actually crates without Cargo.toml, the test author needs to call test_logger::init() in the beginning of a test.

Usage

To assert that a given message was logged, use the assert_logged function.

apache_avro_test_helper::logger::assert_logged("An expected message");
Commit count: 3942

cargo fmt