8

In Clojure, I have decided to move from writing :test metadata elements to using deftest. To see that I have written the deftest correctly, I try reloading and running the tests with a reload in the REPL.

While I don't care about duplicate tests per se, when I remove a test from the source, I would like it removed when I reload the source. Clearing the REPL doesn't remove the tests.

So, How many I remove tests defined via deftest from the Clojure REPL

2 Answers 2

8

clojure.test finds test vars by reflecting on namespaces, so you can use ns-unmap. For full details, see my earlier answer to a similar question

0

I don't think you can remove vars one-by-one in clojure (I may be wrong; it seems like a strange oversight if that's true). The easiest way to get rid of old definitions is probably to use remove-ns to get rid of the namespace and then re-evaluate the file / namespace / definitions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.