A test fixture is setup and teardown code that establishes and cleans up the context required by a test. In clojure.test, fixtures wrap test execution so shared preparation and cleanup happen consistently. section 22.9
A fixture typically follows this contract:
- Accept the test function as an argument. section 22.9
- Run preparation before invoking the test function, then perform cleanup afterward. section 22.9
- Register with use-fixtures, choosing :each to apply the fixture around every test. section 22.9
A per-test fixture
Define (defn setup [tests] (println "### before") (tests) (println "### after")), register it with (use-fixtures :each setup), and run the suite. Two tests produce before/after output twice, followed by a passing summary. section 22.9









