4 releases (breaking)

0.17.0 Aug 5, 2024
0.16.0 Sep 26, 2023
0.15.0 Jul 10, 2023
0.14.0 Aug 3, 2022

#1380 in Encoding

Download history 35/week @ 2024-08-12 19/week @ 2024-08-19 18/week @ 2024-08-26 14/week @ 2024-09-02 12/week @ 2024-09-09 12/week @ 2024-09-16 32/week @ 2024-09-23 20/week @ 2024-09-30 10/week @ 2024-10-07 21/week @ 2024-10-14 2/week @ 2024-10-21 16/week @ 2024-11-04 26/week @ 2024-11-18 17/week @ 2024-11-25

59 downloads per month
Used in apache-avro

Apache-2.0

29KB
672 lines

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");

Dependencies

~3–11MB
~127K SLoC