Try

(use-fixtures :once 
  (fn [f]
    (println "before") 
    (try (f) 
      (finally (println "after")))))

O mércores, 25 de novembro de 2020 á/s 00:17:03 UTC+1, 
stuart.will...@gmail.com escribiu:

> Hello,
>
> I'm experimenting with fixtures and it seems like :after fixtures aren't 
> run if a test unexpectedly errors. E.g.:
>
> (use-fixtures :once {:before #(println "before")
>                      :after #(println "after")})
>
> (deftest a-test
>   (raise (js/Error. "oops")))
>
> In this example I expected to see "after" printed somewhere after the test 
> failed. Is this intentional?
>
> (I'm writing some tests for an Electron app using Spectron and want to 
> make sure the app is always shut down after the tests are complete.)
>
> Regards,
> Stuart
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/84dff1cf-6ea0-438c-a4c0-fac097223201n%40googlegroups.com.

Reply via email to