Trait TestContext

Source
pub trait TestContext
where Self: Sized,
{ // Required method fn setup() -> Self; // Provided method fn teardown(self) { ... } }
Expand description

The trait to implement to get setup/teardown functionality for tests.

Required Methods§

Source

fn setup() -> Self

Create the context. This is run once before each test that uses the context.

Provided Methods§

Source

fn teardown(self)

Perform any additional cleanup of the context besides that already provided by normal “drop” semantics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> TestContext for T