Ticket #2899 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

addCleanup should run even if setUp fails.

Reported by: jml Owned by: jml
Priority: highest Milestone:
Component: trial Keywords:
Cc: therve Branch: branches/addCleanup-2899
Author: Launchpad Bug:

Description

Currently, Trial's TestCase provides no way to add tear-down code that runs if setUp fails (pyunit shares this bug). addCleanup, being a new method, should add cleanup functions that run even if tearDown does not.

Change History

Changed 3 years ago by jml

  • branch set to branches/addCleanup-2899

(In [21763]) Branching to 'addCleanup-2899'

Changed 3 years ago by jml

  • priority changed from high to highest
  • keywords review added
  • owner jml deleted

Changed 3 years ago by therve

  • owner set to therve

Changed 3 years ago by therve

  • owner changed from therve to jml
  • keywords review removed
  • cc therve added

Thank you pyflakes:

twisted/trial/test/test_tests.py:704: undefined name 'SkipTest'

Otherwise, that looks good :).

Changed 3 years ago by jml

  • status changed from new to closed
  • resolution set to fixed

(In [21787]) Make cleanup methods added with addCleanup run even if setUp fails.

  • Author: jml
  • Reviewer: therve
  • Fixes #2899

Previously, addCleanup cleanup methods ran only if setUp succeeded.

Note: See TracTickets for help on using tickets.