Opened 12 years ago

Closed 12 years ago

#2899 defect closed fixed (fixed)

addCleanup should run even if setUp fails.

Reported by: Jonathan Lange Owned by:
Priority: highest Milestone:
Component: trial Keywords:
Cc: therve Branch: branches/addCleanup-2899
branch-diff, diff-cov, branch-cov, buildbot
Author:

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 (6)

comment:1 Changed 12 years ago by Jonathan Lange

Branch: branches/addCleanup-2899

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

comment:2 Changed 12 years ago by Jonathan Lange

Keywords: review added
Owner: Jonathan Lange deleted
Priority: highhighest

comment:3 Changed 12 years ago by therve

Owner: set to therve

comment:4 Changed 12 years ago by therve

Cc: therve added
Keywords: review removed
Owner: changed from therve to Jonathan Lange

Thank you pyflakes:

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

Otherwise, that looks good :).

comment:5 Changed 12 years ago by Jonathan Lange

Resolution: fixed
Status: newclosed

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

comment:6 Changed 9 years ago by <automation>

Owner: Jonathan Lange deleted
Note: See TracTickets for help on using tickets.