`lein test` crashes when clojure.test.check.clojure-test is required at runtime

Description

This isn't test.check's fault, but it may become common enough that it warrants accounting for somehow.

lein test monkeypatches clojure.test/report, which causes it to no longer be a multimethod.

clojure.test.check.clojure-test extends the multimethod when the namespace is loaded.

It appears the monkeypatching doesn't happen until after all namespaces are required, so this is not normally an issue.

However, clojure.spec loads some of test.check at runtime.

Although it may be that this is only a problem on versions <= 0.9.0, when clojure.test.check require clojure.test.check.clojure-test; now that that dependency has been reversed, this may not happen in practice.

If it's determined that this is common enough to do something about, we could wrap the defmethods in a check to make sure the thing is currently a multimethod, and print a warning if not.

Environment

None

Activity

Show:
gfredericks
July 21, 2016, 3:25 AM

Closing this since I don't expect it to be an issue worth working on. Can reopen if something changes.

Alex Miller
August 3, 2016, 4:19 PM

In case someone does run into this, you can work around it by telling lein not to monkeypatch clojure-test:

You will lose "lein retest" functionality, but I don't think many people use that anyways.

Completed

Assignee

gfredericks

Reporter

gfredericks

Labels

None

Approval

None

Patch

None

Priority

Major