You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that Test::Class's current behavior with regard to the
interaction between failed startup methods and shutdown methods is
undesirable. I believe that shutdown methods should always run, even
if there's a failure in a startup method.
I frequently have tests where I set up several things in a startup
method, beginning with creating a test account (which is a number of
related rows in a database). My shutdown methods for such test
classes then always include deleting all the rows related to that
account from the database. If the first thing I do in a startup
method is create that account, but the second thing in the method
tries to do something with it which fails unexpectedly (perhaps
throwing an exception in the startup method), I still want my
shutdown method to run and remove the DB rows.
I have attached a patch against 0.36 to implement this behavior
(which I feel is more correct).
I believe that Test::Class's current behavior with regard to the
interaction between failed startup methods and shutdown methods is
undesirable. I believe that shutdown methods should always run, even
if there's a failure in a startup method.
I frequently have tests where I set up several things in a startup
method, beginning with creating a test account (which is a number of
related rows in a database). My shutdown methods for such test
classes then always include deleting all the rows related to that
account from the database. If the first thing I do in a startup
method is create that account, but the second thing in the method
tries to do something with it which fails unexpectedly (perhaps
throwing an exception in the startup method), I still want my
shutdown method to run and remove the DB rows.
I have attached a patch against 0.36 to implement this behavior
(which I feel is more correct).
Original: https://rt.cpan.org/Ticket/Display.html?id=72537
The text was updated successfully, but these errors were encountered: