-
Notifications
You must be signed in to change notification settings - Fork 27
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
Should catch unexpected exceptions and fail the test suite #59
Comments
I'm having trouble reproducing this. E.g.:
|
I see, thanks. I used |
Looks like the problem is reproducible because of Unfortunately, the default reporting is not very helpful: it is very long and noisey (~300 lines in |
Ah, seems like the redefined |
I'm confused by these two statements, which seem contradictory:
If you could post some code (and |
Sure, sorry for confusion.
The library catches the unexpected exception and reports it. So it is good.
I meant that I can't redefine what the library outputs when it reports the unexepected error. Unless the broken The example: ; deps.clj
{:deps {com.gfredericks/test.chuck {:mvn/version "0.2.9"}
org.clojure/test.check {:mvn/version "0.10.0-alpha3"}}} ; the-test.clj
(ns the-test
(:require
[clojure.test.check.generators :as gen]
[com.gfredericks.test.chuck.clojure-test :as chuck]
[clojure.test :as ct :refer :all]))
(deftest foo
(chuck/checking
"bar"
10
[x gen/int]
(throw (ex-info "oops" {}))))
(run-tests) This is the output:
I find this report to be very difficult to interpret, because it's long (~380 lines in |
I think this hinges on this function, which does something different depending on whether the tests threw an exception or not. The I think this would give you what you need, does that sound right? |
Yes, sounds good! |
Is this something you can help with with a pull request? |
Sure, will do in spare time. |
Example:
Expected:
Actual:
My current workaround is to redefine the reporting method so that it always "fails" the test via
(is false)
:Output:
Workaround output for the expected failure:
The text was updated successfully, but these errors were encountered: