Closed nberger closed 9 years ago
Use test-vars instead of test-var so the test runs with the fixtures applied. That's the expected behavior when running a test. It's also what's being done when multiple tests are matched.
test-vars
test-var
As an example:
(require '[clojure.test :refer :all]) (def ^:dynamic *a* 0) (defn set-a1 [f] (binding [*a* 1] (f))) (use-fixtures :each set-a1) (deftest a-test (is (= *a* 1))) (test-var #'a-test) ;=> FAIL (test-vars [#'a-test]) ;=> OK
Use
test-vars
instead oftest-var
so the test runs with the fixtures applied. That's the expected behavior when running a test. It's also what's being done when multiple tests are matched.As an example: