[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3600: allmydata.test.common.*TestCase have broken skip/cleanup interaction

Tahoe-LAFS trac at tahoe-lafs.org
Tue Jan 26 21:20:06 UTC 2021


#3600: allmydata.test.common.*TestCase have broken skip/cleanup interaction
---------------------+---------------------------
 Reporter:  exarkun  |          Owner:
     Type:  defect   |         Status:  new
 Priority:  normal   |      Milestone:  undecided
Component:  unknown  |        Version:  n/a
 Keywords:           |  Launchpad Bug:
---------------------+---------------------------
 Cleanups added using `testtools.TestCase.addCleanup` are never run if the
 test they're associated with is skipped using `unittest.skip` (or one of
 its cousins).

 This is usually fine because if the test is going to be skipped like this
 then you usually can't call `addCleanup`.

 But `allmydata.test.eliotutil.EliotLoggedRunTest` uses `eliot_logged_test`
 to call `addCleanup` *before* `testtools.TestCase.run` is called.

 This means `addCleanup` is called and then `run` applies its skip logic to
 not run any of the cleanups.

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3600>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list