[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: Thanks for the fix, Serhiy, and Ryan for reporting the problem! ✨ 🍰 ✨ -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread miss-islington
miss-islington added the comment: New changeset d65fad04fad1a73b6bb17bcb08ca6f0a24376952 by Miss Islington (bot) in branch '3.10': bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) https://github.com/python/cpython/commit/d65fad04fad1a73b6bb17bcb08ca6f0a24376952

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 9827710a400848c9430ed364ed5d2d54f0926701 by Serhiy Storchaka in branch '3.9': [3.9] bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) (GH-28071) https://github.com/python/cpython/commit/9827710a400848c9430ed364ed5d2d54

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26515 pull_request: https://github.com/python/cpython/pull/28071 ___ Python tracker ___

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +26514 pull_request: https://github.com/python/cpython/pull/28070 ___ Python tracker

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-30 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 08d9e597c8ef5a2b26375ac954fdf224f5d82c3c by Serhiy Storchaka in branch 'main': bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) https://github.com/python/cpython/commit/08d9e597c8ef5a2b26375ac954fdf224f5d82c3c --

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +26448 pull_request: https://github.com/python/cpython/pull/28006 ___ Python tracker ___

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are several other bugs in the code for cleaning up classes and modules: * Functions registered with addClassCleanup() are not called if tearDownClass is set to None or its look up raises AttributeError. * Buffering in TestResult blows up when function

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.11 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Functions registered with TestCase.addClassCleanup are called because TestCase has default implementation of tearDownClass. But you can suppress it by setting tearDownClass = None. So there is a similar issue with class cleanup functions. -- nosy:

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-05-03 Thread Miguel Brito
Miguel Brito added the comment: Thanks terry.reedy, actually I read it in the mailing list, someones comment not a guideline. Do you mind having a look at the PR? -- ___ Python tracker

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-05-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: No apology needed. I don't know what has been added to the devguide, but most OPs never submit a PR unless they either do so or say they will when opening an issue. In any case, a week is more than a chance. --

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-05-01 Thread Miguel Brito
Miguel Brito added the comment: I was reading through the dev guide and past issues and I didn't know it's advisable to give the author of the issue a chance to submit the PR. Sorry about that, you can close mine in this case. -- ___ Python tracke

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-04-28 Thread Miguel Brito
Miguel Brito added the comment: Hello, first time here. I created an PR for that. Managed to reproduce the issue both manually and via unit test. I hope there's no edge case but all tests pass on my machine. -- nosy: +miguendes ___ Python tracker

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-04-28 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +24390 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25700 ___ Python tracker

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: import unittest #def setUpModule(): raise Exception() #def tearDownModule(): print('module teardown') unittest.addModuleCleanup(print, 'module cleanup') class Dummy(unittest.TestCase): def test_dummy(self): self.addCleanup(print, 'test cleanup')

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-04-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- stage: -> needs patch versions: +Python 3.10, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list

[issue43913] unittest module cleanup functions not run unless tearDownModule() is defined

2021-04-22 Thread Ryan Tarpine
New submission from Ryan Tarpine : Functions registered with unittest.addModuleCleanup are not called unless the user defines tearDownModule in their test module. This behavior is unexpected because functions registered with TestCase.addClassCleanup are called even the user doesn't define tea