我认为这是“按设计”的,并且一些扩展 clojure.test 行为的工具依赖于这一点。clojure.test 名空间字符串说明中有以下内容
SAVING TEST OUTPUT TO A FILE
All the test reporting functions write to the var *test-out*. By
default, this is the same as *out*, but you can rebind it to any
PrintWriter. For example, it could be a file opened with
clojure.java.io/writer.
存在一个 with-test-out
宏,它是专门为测试报告员设计的,这样他们就可以依赖这种行为
(defmacro with-test-out
"Runs body with *out* bound to the value of *test-out*."
{:added "1.1"}
[& body]
`(binding [*out* *test-out*]
~@body))