test-fork
A custom #[test] attribute that makes sure to run the test in a
separate process. Process separation can be useful in many contexts,
including when testing interactions with necessarily process-global
state (e.g., when working environment variables, when testing code that
requires temporary user ID switching, or when adjusting the working
directory).
Usage
This crate provides the #[test_fork::test] attribute that can be used
for annotating tests to run in separate processes, as opposed to sharing
the address space with other concurrently running tests:
use test;
The crate also supports an alternative syntax that nests more easily
with other custom #[test] attributes and which allows for easier
annotation of individual tests (e.g., if only a sub-set is meant to
be run in separate processes):
use test as fork;