[issue24412] setUpClass equivalent for addCleanup

2019-06-10 Thread Lisa Roach
Change by Lisa Roach : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue24412] setUpClass equivalent for addCleanup

2018-11-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- pull_requests: +10041 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24412] setUpClass equivalent for addCleanup

2018-11-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: /home/serhiy/py/cpython/Lib/unittest/test/test_runner.py:259: DeprecationWarning: Please use assertEqual instead. self.assertEquals(e, 'cleanup1') -- ___ Python tracker

[issue24412] setUpClass equivalent for addCleanup

2018-11-08 Thread Lisa Roach
Lisa Roach added the comment: New changeset 0f221d09cad46bee38d1b7a7822772df66c53028 by Lisa Roach in branch 'master': bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) https://github.com/python/cpython/commit/0f221d09cad46bee38d1b7a7822772df66c53028 -- nosy:

[issue24412] setUpClass equivalent for addCleanup

2018-09-27 Thread Robert Collins
Robert Collins added the comment: Serhiy, thats not a design flaw, its a feature. in a class hierarchy, setup and teardown ordering is undefined: implementors can choose whatever order they want to execute in. e.g. class A(TestCase): def setUp(self): super().setUp() acquire1() class

[issue24412] setUpClass equivalent for addCleanup

2018-09-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.8 -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue24412] setUpClass equivalent for addCleanup

2018-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a design issue with the order of cleaning up. tearDown() is purposed to release resources acquired in setUp(). Resources acquired in test methods will be released in doCleanup() if use addCleanup(), but since doCleanup() is called after

[issue24412] setUpClass equivalent for addCleanup

2018-09-11 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +8628 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue24412] setUpClass equivalent for addCleanup

2017-09-28 Thread Tal Einat
Change by Tal Einat : -- nosy: -taleinat ___ Python tracker ___ ___ Python-bugs-list

[issue24412] setUpClass equivalent for addCleanup

2017-06-29 Thread Daryl Blanc
Changes by Daryl Blanc : -- nosy: +dablanc ___ Python tracker ___ ___ Python-bugs-list

[issue24412] setUpClass equivalent for addCleanup

2016-09-11 Thread Robert Collins
Robert Collins added the comment: Btw some things to be aware of in addressing this: - we will need tests that catchable exceptions raised from a setUpModule or setUpClass cause cleanups already registered to run - if (and I'd need to check this) setUpModule or setUpClass can nest - I think

[issue24412] setUpClass equivalent for addCleanup

2016-09-11 Thread Robert Collins
Robert Collins added the comment: So, thank you for the patch. However - there's no need for a metaclass here, and its actively harmful to comprehending the code. As I suggested earlier, please decouple the cleanups implementation and then consume it from the two places that it will be needed

[issue24412] setUpClass equivalent for addCleanup

2015-07-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file39844/addCleanupClass.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24412

[issue24412] setUpClass equivalent for addCleanup

2015-06-22 Thread Akshit Khurana
Changes by Akshit Khurana axitkhur...@gmail.com: -- nosy: +axitkhurana ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24412 ___ ___

[issue24412] setUpClass equivalent for addCleanup

2015-06-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: contextlib.ExitStack could help you. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24412 ___ ___

[issue24412] setUpClass equivalent for addCleanup

2015-06-19 Thread R. David Murray
R. David Murray added the comment: That would not make it simpler. In fact it would make the test code more complex. I'd still need the safeSetUpClass dodge (or repeat the try/except/log in every setUpClass method), and I'd have to have a wrapper function that I passed each cleanup to as an

[issue24412] setUpClass equivalent for addCleanup

2015-06-19 Thread R. David Murray
R. David Murray added the comment: As further motivation, I actually tried to implement this using try/except. First I wrote a loop in tearDownClass that ran each of the cleanups inside a try/except and printed the exception if there was one. But of course that doesn't run if setUpClass

[issue24412] setUpClass equivalent for addCleanup

2015-06-19 Thread Tal Einat
Tal Einat added the comment: I'm convinced. +1 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24412 ___ ___ Python-bugs-list mailing list

[issue24412] setUpClass equivalent for addCleanup

2015-06-13 Thread R. David Murray
R. David Murray added the comment: Not having addClassCleanup means that my setUpClass method will have four try/excepts in it, as will my tearDownClass (I have four fixtures I'm setting up for the tests). So, no, it isn't strictly needed, but it is prettier :). As Robert says, though, it

[issue24412] setUpClass equivalent for addCleanup

2015-06-13 Thread Tal Einat
Tal Einat added the comment: Is this really needed? One can use try/except/raise, and since addClassCleanup() would only be called from setUpClass(), I don't quite see the utility of it. -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org

[issue24412] setUpClass equivalent for addCleanup

2015-06-13 Thread Tal Einat
Tal Einat added the comment: I'm not convinced this would be worth the effort required to implement and maintain it. Can someone find examples from existing test suites where this would clearly be useful? For example, a setUpClass() or setUpModule() function with multiple try/finally

[issue24412] setUpClass equivalent for addCleanup

2015-06-13 Thread Robert Collins
Robert Collins added the comment: It would be nice for symmetry. I mean, setUpClass isn't needed either, and we have it ;). however, we actually have two contexts this would be called from - setUpClass and setUpModule; both share their internals. So we probably need a decoupled cleanups

[issue24412] setUpClass equivalent for addCleanup

2015-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: addCleanup() is helpful because it can be used in test methods. addClassCleanup() and addModuleCleanup() can't be used in test methods, and setUpClass() and setUpModule() are used less than setUp(), therefore the benefit of these methods are less than of

[issue24412] setUpClass equivalent for addCleanup

2015-06-13 Thread Tal Einat
Tal Einat added the comment: Ahh, that makes sense. Sounds good to me! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24412 ___ ___

[issue24412] setUpClass equivalent for addCleanup

2015-06-08 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24412 ___ ___ Python-bugs-list mailing

[issue24412] setUpClass equivalent for addCleanup

2015-06-08 Thread R. David Murray
New submission from R. David Murray: Since tearDownClass isn't run if setUpClass fails, there is a need for the class level equivalent of addCleanup. addClassCleanup? -- components: Library (Lib) messages: 245030 nosy: ezio.melotti, michael.foord, r.david.murray, rbcollins priority: