Add clojure.test api to run single test with fixtures and report

Description

Problem

clojure.test does not provide a way for running a single test in a way that reports the test statistics like running all tests in a namespace does.

Context

When developing code, it is sometimes effective to focus on a single failing test, rather than running all tests in a namespace. This can be the case when running the tests takes some amount of time, or when running the tests produces a large volume of failures. The best option for running a single test with fixtures currently is `test-vars` ala:

However, this has the following issues:

  • No test reporting feedback such as you get with run-tests (on success, there is no output)

  • Need to specify var (not symbols) wrapped in a vector

Proposed: A new macro `run-test` that specifies a single symbol and does the same test reporting you get with `run-tests`. Usage:

Patch: CLJ-1908-3.patch

Screened: Alex Miller

Environment

None

Attachments

1

Activity

Show:

Alex Miller September 14, 2021 at 6:02 PM

already fixed, thx

Ambrose Bonnaire-Sergeant September 14, 2021 at 5:53 PM

Ship has sailed for some of this, but FWIW I think the merged patch has the wrong `:added` version (is 1.9, should be 1.11) and references the wrong issue in the title.

Alex Miller September 14, 2021 at 2:47 PM

Applied for 1.11.0-alpha2

Howard Lewis Ship April 8, 2016 at 8:51 PM

Updated patch, squashed and reflecting all of Alex's comments.

Howard Lewis Ship April 4, 2016 at 4:52 PM

Thanks for the input; I'll have an updated patch shortly.

Fixed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created April 1, 2016 at 5:01 PM
Updated September 14, 2021 at 6:02 PM
Resolved September 14, 2021 at 2:47 PM