@cjsauer I remember, there is a wrong case in readme with postmortem handler. You need to wrap not a fixture, but your test.
@cjsauer I mean, use something like that:
(deftest my-test
(with-postmortem {...}
(some code)))
@metametadata makes perfect sense, I'll give that a try. In one of my test cases I was indeed using is
.
@igrishaev interesting. Is there some workaround for wrapping the whole fixture? I imagine I'd end up wrapping every deftest
in a postmortem handler...checking the source of clojure.test, it looks like it's test-var
that is swallowing the exception https://github.com/clojure/clojure/blob/master/src/clj/clojure/test.clj#L707
@cjsauer I created an issue for that in the repo.
Wrapping each tests would be annoying, I know.
I'm happy to help discuss solutions, or even work on a PR
@igrishaev It seems that etaoin mostly relies on exceptions to mean failure, and the lack of exception to mean success. The reason I get this impression is because of functions like has-text?
; the assertion is implicit, and so something like is
is maybe redundant. Maybe we could rely on clojure.test's runners only, and then use something like test-ns-hook
as an entry point. This would allow us full control over exception catching.
@cjsauer has-text?
and some other functions that end with question mark usually do not raise an exception but return strict boolean result; of you face an exception when running has-text?
, that means wrong function design.
And keep in mind, the library might be used not only for tests but for automation.
@igrishaev ah I see. That actually makes a lot more sense from a composition standpoint.
>in order to catch all test fails you'd need to re-bind clojure.test/report
I think this is an interesting solution, and something that with-postmortem
could potentially do on-the-fly
Problem is that it makes the assumption that you're using clojure.test
Maybe a with-test-postmortem
could be created