Clojure

clojure.test use-fixtures function composes fixture functions repeatedly

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.1
  • Component/s: None
  • Labels:
    None
  • Approval:
    Ok

Description

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))).

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/194 Attachments: 0001-Don-t-repeatedly-compose-on-calls-to-use-fixtures.-F.patch - https://www.assembla.com/spaces/clojure/documents/cU7IgoS2Or3PCKeJe5aVNr/download/cU7IgoS2Or3PCKeJe5aVNr 0001-Don-t-repeatedly-compose-on-calls-to-use-fixtures.-F.patch - https://www.assembla.com/spaces/clojure/documents/a51RI-S2Wr3PxveJe5aVNr/download/a51RI-S2Wr3PxveJe5aVNr
Hide
Assembla Importer added a comment -

technomancy said: [file:cU7IgoS2Or3PCKeJe5aVNr]: Patch with a fix.

Show
Assembla Importer added a comment - technomancy said: [file:cU7IgoS2Or3PCKeJe5aVNr]: Patch with a fix.
Hide
Assembla Importer added a comment -

technomancy said: Fix attached.

Show
Assembla Importer added a comment - technomancy said: Fix attached.
Hide
Assembla Importer added a comment -

technomancy said: [file:a51RI-S2Wr3PxveJe5aVNr]: Fixed patch

Show
Assembla Importer added a comment - technomancy said: [file:a51RI-S2Wr3PxveJe5aVNr]: Fixed patch
Hide
Assembla Importer added a comment -

technomancy said: Ignore that first patch; the implementation worked, but the test was silly.

Show
Assembla Importer added a comment - technomancy said: Ignore that first patch; the implementation worked, but the test was silly.
Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - mikehinchey said: Backport for contrib clojure-1.0-compatibility
Hide
Assembla Importer added a comment -

technomancy said: (In [[r:f5f2943dfd0128744227c3f42a630ea10dd40b24]]) Don't repeatedly compose on calls to use-fixtures. Fixes #194.

Updated tests and added a docstring to use-fixtures.

Signed-off-by: Chouser <chouser@n01se.net>

Branch: master

Show
Assembla Importer added a comment - technomancy said: (In [[r:f5f2943dfd0128744227c3f42a630ea10dd40b24]]) Don't repeatedly compose on calls to use-fixtures. Fixes #194. Updated tests and added a docstring to use-fixtures. Signed-off-by: Chouser <chouser@n01se.net> Branch: master

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: