7

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

Community
  • 1
  • 1
Havvy
  • 1,471
  • 14
  • 27

2 Answers2

7

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

Community
  • 1
  • 1
Stuart Dabbs Halloway
  • 1,658
  • 12
  • 10
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.

Joost Diepenmaat
  • 17,633
  • 3
  • 44
  • 53