[issue16599] unittest: Access test result from tearDown

2014-08-22 Thread Claudiu Popa
Changes by Claudiu Popa : -- resolution: -> rejected stage: needs patch -> resolved status: open -> closed ___ Python tracker ___ ___

[issue16599] unittest: Access test result from tearDown

2014-07-02 Thread Mark Lawrence
Mark Lawrence added the comment: The solution suggested in msg176909 seems accepted all around so can we please close this. -- nosy: +BreamoreBoy versions: +Python 3.5 -Python 3.4 ___ Python tracker __

[issue16599] unittest: Access test result from tearDown

2012-12-27 Thread Chris Jerdonek
Chris Jerdonek added the comment: I agree with Serhiy here. This use case seems too specialized, and there are easy ways to achieve the same thing in code. -- nosy: +chris.jerdonek ___ Python tracker

[issue16599] unittest: Access test result from tearDown

2012-12-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Anatoly, if this is good for you, please close the issue. -- ___ Python tracker ___ ___ Python-bug

[issue16599] unittest: Access test result from tearDown

2012-12-04 Thread anatoly techtonik
anatoly techtonik added the comment: On Tue, Dec 4, 2012 at 3:43 PM, Michael Foord wrote: > > Well, addSuccessCleanup *would* be an api for adding a cleanup - one that > is only called on success. So the cleanup is skipped on failure or error, > which was the original use case. > I thought it w

[issue16599] unittest: Access test result from tearDown

2012-12-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why do you need it? You can add a test result depended code at the end of the test method. For example set a special flag def setUp(self): self.success = False def tearDown(self): if not self.success: ... def test_xxx

[issue16599] unittest: Access test result from tearDown

2012-12-04 Thread Michael Foord
Michael Foord added the comment: Well, addSuccessCleanup *would* be an api for adding a cleanup - one that is only called on success. So the cleanup is skipped on failure or error, which was the original use case. "Additional consideration that the need to leave the test results is a user run

[issue16599] unittest: Access test result from tearDown

2012-12-04 Thread anatoly techtonik
anatoly techtonik added the comment: addSuccessCleanup is not the best name as it assumes that some cleanup is being added, which is confusing. Additional consideration that the need to leave the test results is a user run time preference, which may only be actual when debugging or working on

[issue16599] unittest: Access test result from tearDown

2012-12-04 Thread Michael Foord
Michael Foord added the comment: Changing the signature of tearDown would be backwards incompatible. addSuccessCleanup is an interesting idea - cleanup functions that are only executed if the test passes. (What to do if a cleanup function raises an exception though? And when do these get execu

[issue16599] unittest: Access test result from tearDown

2012-12-04 Thread anatoly techtonik
anatoly techtonik added the comment: Or call tearDown() with some parameter that it's able to retrieve. -- ___ Python tracker ___ ___

[issue16599] unittest: Access test result from tearDown

2012-12-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Another solution would be to add a new method named addSuccessCleanup. -- nosy: +michael.foord, pitrou ___ Python tracker ___ __

[issue16599] unittest: Access test result from tearDown

2012-12-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16599] unittest: Access test result from tearDown

2012-12-03 Thread Daniel Urban
Changes by Daniel Urban : -- stage: -> needs patch type: -> enhancement versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker ___ ___

[issue16599] unittest: Access test result from tearDown

2012-12-03 Thread anatoly techtonik
New submission from anatoly techtonik: A common usage pattern is to prevent clean up in tearDown() if the test failed. However, it requires a hack: http://stackoverflow.com/questions/4414234/getting-pythons-unittest-results-in-a-teardown-method. Would be nice to have an officially documented f