how do i get rid of duplicate clojure test-is unit tests on the REPL

南笙酒味 提交于 2019-12-11 02:13:55

问题


I have a little script

(use 
 :reload-all
 'com.example.package1
 'com.example.package2
 'com.example.package3
 'com.example.testlib)

(run-tests
 'com.example.package1
 'com.example.package2
 'com.example.package3)

that I use to quickly reload everything and fire off the unit tests.
trouble is that each time (deftest ... ) is evaluated as the files are read an additional test is created so after working hard all day each test is now being run 103 times, eek!


回答1:


There is a flag *load-tests* which determines the behaviour of deftest. (doc deftest) seems to implicate that setting this flag to false could solve your problem.



来源:https://stackoverflow.com/questions/1157411/how-do-i-get-rid-of-duplicate-clojure-test-is-unit-tests-on-the-repl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!