Skip to content
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

Conversation

FelipeCortez
Copy link
Contributor

This PR fixes test reporting for libraries that rely on custom print logic that can be added by (defmethod print-method ,,,, such as matcher-combinators: clojure-emacs/cider#2901 (comment)

@@ -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 %)))]
Copy link
Member

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.

Copy link
Contributor Author

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?

@bbatsov
Copy link
Member

bbatsov commented Nov 22, 2020

Don't forget to add a changelog entry for this bug-fix.

@FelipeCortez FelipeCortez requested a review from bbatsov November 23, 2020 19:18
@bbatsov bbatsov merged commit 24fd2ff into clojure-emacs:master Nov 23, 2020
@bbatsov
Copy link
Member

bbatsov commented Nov 23, 2020

Looks good. Thanks!

temochka added a commit to temochka/cider-nrepl that referenced this pull request Sep 17, 2021
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.
temochka added a commit to temochka/cider-nrepl that referenced this pull request Sep 17, 2021
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.
temochka added a commit to temochka/cider-nrepl that referenced this pull request Oct 20, 2021
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.
temochka added a commit to temochka/cider-nrepl that referenced this pull request Oct 20, 2021
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.
bbatsov pushed a commit that referenced this pull request Oct 21, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants