File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717; ; Prevent clj-refactor from "cleaning" these from the ns form
1818(require 'kaocha.monkey-patch)
1919
20- (def orig-out *out*)
20+ ; ; Before orig-out was set to *out*, and unfortunately that will
21+ ; ; cause a ClassCastException.
22+ ; ; => "java.io.OutputStreamWriter cannot be cast to java.io.PrintStream"
23+ ; ; Explanation:
24+ ; ; The exception is because that when user interruption happens,
25+ ; ; Kaocha will force resetting printing to stdout. However, *out*
26+ ; ; is of class java.io.OutputStreamWriter, but System/out is of
27+ ; ; class java.io.PrintStream
28+ (def orig-out System /out )
29+ (def orig-err System /err )
2130
2231(def ^:dynamic *active?*
2332 " Is Kaocha currently active? i.e. loading or runnning tests."
112121 (count (testable/test-seq-with-skipped test-plan))))
113122 (output/warn (str " No tests were found. This may be an issue in your Kaocha test configuration."
114123 " To investigate, check the :test-paths and :ns-patterns keys in tests.edn." )))
115- (throw+ {:kaocha/early-exit 0 }))
124+ (throw+ {:kaocha/early-exit 0 }))
116125
117126 (when (find-ns 'matcher-combinators.core)
118127 (require 'kaocha.matcher-combinators))
130139 ; ; still be in effect.
131140 (System/setOut
132141 orig-out)
142+ (System/setErr
143+ orig-err)
133144 (binding [history/*history* history]
134145 (t/do-report (history/clojure-test-summary )))
135146 (catch Throwable t
You can’t perform that action at this time.
0 commit comments