test-ns runs the tests associated with a namespace, prints a summary, and honors a namespace-level test-ns-hook when one is defined. Without a hook, it behaves almost like test-all-vars; with a hook, it executes the hook instead of discovering every test var. section 22.9
Selecting tests with a namespace hook
(ns composable-tests) (require '[clojure.test :refer [is deftest]]) (deftest fail-a (is (= 1 (+ 2 2)))) (deftest fail-b (is (= 1 (+ 2 2)))) (deftest fail-c (is (= 1 (+ 2 2)))) (defn test-ns-hook [] (fail-a) (fail-c)) (test-ns 'composable-tests) ;; {:test 2, :pass 0, :fail 2, :error 0} The hook runs fail-a and fail-c, while fail-b is skipped.
