-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom print-methods in test reports #683
Support custom print-methods in test reports #683
Conversation
src/cider/nrepl/middleware/test.clj
Outdated
@@ -72,7 +76,7 @@ | |||
c (when (seq test/*testing-contexts*) (test/testing-contexts-str)) | |||
i (count (get-in (@current-report :results) [ns (:name (meta v))])) | |||
gen-input (:gen-input @current-report) | |||
pprint-str #(with-out-str (pp/pprint %))] | |||
pprint-str #(with-out-str (if (custom-print-method? %) (pp/pprint %) (println %)))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also be a good idea to add some comment explaining the need for this, and ideally a unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbatsov done! can you check again?
Don't forget to add a changelog entry for this bug-fix. |
Looks good. Thanks! |
The changes introduced in clojure-emacs#683 resulted in test results always being printed via println instead of clojure.pprint/pprint. BetterThanTomorrow/calva#1280 describes the degraded user experience caused by this issue.
The changes introduced in clojure-emacs#683 resulted in test results always being printed via println instead of clojure.pprint/pprint. BetterThanTomorrow/calva#1280 describes the degraded user experience caused by this issue.
The changes introduced in clojure-emacs#683 resulted in test results always being printed via println instead of clojure.pprint/pprint. BetterThanTomorrow/calva#1280 describes the degraded user experience caused by this issue. This PR limits println usage to matchers-combinators results.
The changes introduced in clojure-emacs#683 resulted in test results always being printed via println instead of clojure.pprint/pprint. BetterThanTomorrow/calva#1280 describes the degraded user experience caused by this issue. This PR limits println usage to matchers-combinators results.
The changes introduced in #683 resulted in test results always being printed via println instead of clojure.pprint/pprint. BetterThanTomorrow/calva#1280 describes the degraded user experience caused by this issue. This PR limits println usage to matchers-combinators results.
This PR fixes test reporting for libraries that rely on custom print logic that can be added by
(defmethod print-method ,,,
, such asmatcher-combinators
: clojure-emacs/cider#2901 (comment)