Repository navigation
Always use unittest for collecting tests in regrtests #89392
Copy link
Copy link
Closed
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.9 (EOL)end of lifeend of lifetestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/serhiy-storchaka'
closed_at = None
created_at = <Date 2021-09-17.07:31:12.126>
labels = ['type-feature', 'tests', '3.9', '3.10', '3.11']
title = 'Always use unittest for collecting tests in regrtests'
updated_at = <Date 2021-10-20.16:52:45.847>
user = 'https://github.com/serhiy-storchaka'bugs.python.org fields:
activity = <Date 2021-10-20.16:52:45.847>
actor = 'lukasz.langa'
assignee = 'serhiy.storchaka'
closed = False
closed_date = None
closer = None
components = ['Tests']
creation = <Date 2021-09-17.07:31:12.126>
creator = 'serhiy.storchaka'
dependencies = ['40058', '40173', '45185', '45187', '45500', '45502']
files = []
hgrepos = []
issue_num = 45229
keywords = ['patch']
message_count = 33.0
messages = ['402006', '402009', '402053', '402076', '402154', '402156', '402168', '402195', '402214', '402228', '402245', '402254', '402255', '402903', '402945', '402952', '402953', '402956', '402959', '402974', '402982', '402996', '402999', '403000', '403846', '403853', '403855', '404137', '404142', '404143', '404466', '404495', '404496']
nosy_count = 7.0
nosy_names = ['terry.reedy', 'lukasz.langa', 'lukasz.langa', 'zach.ware', 'serhiy.storchaka', 'pablogsal', 'miss-islington', 'jerrylikerice1s']
pr_nums = ['28405', '28454', '28455', '28456', '28467', '28468', '28478', '28479', '28615', '28637', '28639', '28645', '28650', '28660', '28666', '28667', '28668', '28927', '28929', '28986', '29004', '29006', '29007', '29095', '29096']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue45229'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']Linked PRs
- gh-89392: Make test_decimal discoverable #106209
- [3.11] gh-89392: Make test_decimal discoverable (GH-106209) #106229
- [3.12] gh-89392: Make test_decimal discoverable (GH-106209) #106230
- bpo-45229: Make ElementTree tests discoverable #108859
- gh-89392: Remove test_main() in test_netrc #108860
- gh-89392: Make test_pep646_syntax discoverable #108861
- [3.11] gh-89392: Remove test_main() in test_netrc (GH-108860) #108868
- [3.11] gh-89392: Make test_pep646_syntax discoverable (GH-108861) #108869
- [3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861) #108871
- [3.12] gh-89392: Remove test_main() in test_netrc (GH-108860) #108872
- [3.12] bpo-45229: Make ElementTree tests discoverable (GH-108859) #108873
- [3.11] bpo-45229: Make ElementTree tests discoverable (GH-108859) #108874
- gh-89392: Fix running test_pep646_syntax as script #108875
- gh-89392: Remove support of test_main() in libregrtest #108876
- [3.11] gh-89392: Fix running test_pep646_syntax as script (GH-108875) #108877
- [3.12] gh-89392: Remove support of test_main() in libregrtest (GH-108876) #108897
- [3.11] gh-89392: Remove support of test_main() in libregrtest (GH-108876) #108898
- gh-89392: Use normal unittest runner in test_type_cache #108911
- [3.12] gh-89392: Use normal unittest runner in test_type_cache (GH-108911) #108913
- [3.11] gh-89392: Use normal unittest runner in test_type_cache (GH-108911) #108914
- gh-89392: Use unittest test runner for doctests in test_getopt #108916
- [3.12] gh-89392: Use unittest test runner for doctests in test_getopt (GH-108916) #108919
- [3.11] gh-89392: Use unittest test runner for doctests in test_getopt (GH-108916) #108920
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixes3.9 (EOL)end of lifeend of lifetestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Activity
serhiy-storchaka commentedon Sep 17, 2021
Currently regrtest supports two ways of collecting and running tests in module.
If the module contains the "test_main" function, regrtest just calls it. This function usually calls run_unittest() with a list of test classes, composed manually, it can also run doctests with run_doctest(), generate list of test classes dynamically, and run some code before and after running tests.
Otherwise regrtest uses unittest for for collecting tests.
The disadvantage of the former way is that new test classes should be added manually to the list. If you forget to do this, new tests will not be run. See for example bpo-45185 and bpo-45187. Not runned tests can hide bugs.
So it would be better to eliminate human factor and detect tests automatically.
serhiy-storchaka commentedon Sep 17, 2021
PR 28405 contains simple changes for 60 test files. It does not cover files which use complex code for generating list of test classes and running doctests (because there are subtle differences between running doctests with run_doctest() and via DocTestSuite). They are left for the following PRs.
zware commentedon Sep 17, 2021
See also bpo-16748
67 remaining items
pythongh-89392: Use normal unittest runner in test_type_cache
gh-89392: Use normal unittest runner in test_type_cache (GH-108911)
pythongh-89392: Use normal unittest runner in test_type_cache (python…
pythongh-89392: Use normal unittest runner in test_type_cache (python…
pythongh-89392: Use unittest test runner for doctests in test_getopt
[3.11] gh-89392: Use normal unittest runner in test_type_cache (GH-10…
gh-89392: Use unittest test runner for doctests in test_getopt (GH-10…
pythongh-89392: Use unittest test runner for doctests in test_getopt (p…
pythongh-89392: Use unittest test runner for doctests in test_getopt (p…
[3.11] gh-89392: Use unittest test runner for doctests in test_getopt (…
[3.12] gh-89392: Use normal unittest runner in test_type_cache (GH-10…
[3.12] gh-89392: Use unittest test runner for doctests in test_getopt (…
serhiy-storchaka commentedon Sep 9, 2023
Finally it has been finished.