Introduction
Advanced fixtures help set up and clean up complicated test needs easily. They make tests clear and avoid repeating code.
When tests need a database connection that must open before and close after tests.
When you want to prepare test data that many tests will use.
When tests require a special environment setup like a web server running.
When you want to share setup steps across many test files without repeating.
When cleanup actions must happen even if tests fail or stop early.