clojure.contrib.test-is use-fixtures function composes fixture functions repeatedly (Backport clojure #194)
For the clojure-1.0-compatibility branch, copy the fix from http://www.assembla.com/spaces/clojure/tickets/194-clojure-test-use-fixtures-function-composes-fixture-functions-repeatedly
If you call use-fixtures over and over again, it will simply compose the test deeper and deeper into a nesting of the fixture function.
(use-fixtures :each my-cleanup) (deftest my-messy-test […])
Load that a few times and you end up running the equivalent of:
(my-cleanup (my-cleanup (my-cleanup my-messy-test))).
If you call use-fixtures over and over again, it will simply compose the test deeper and deeper into a nesting of the fixture function.
(use-fixtures :each my-cleanup) (deftest my-messy-test […])
Load that a few times and you end up running the equivalent of:
(my-cleanup (my-cleanup (my-cleanup my-messy-test))).
Leave a comment
on 2009-10-14 17:54 *
By mikehinchey
Description changed from For the clojure-1.0-compati... to For the clojure-1.0-compati...
Summary changed from clojure.test use-fixtures function composes fixture functions repeatedly (Backport clojure #194) to clojure.contrib.test-is use-fixtures function composes fixture functions repeatedly (Backport clojure #194)
file:ajZUI6Ur0r3PnzeJe5aVNr: patch copy of clojure 194
on 2009-10-14 17:56 *
By mikehinchey
Status changed from New to Test
Work remaining changed from 1.0 to 0.0