classification
Title: Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, serhiy.storchaka, sobolevn
Priority: normal Keywords: patch

Created on 2021-11-23 09:32 by sobolevn, last changed 2021-12-02 22:45 by sobolevn. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29721 merged sobolevn, 2021-11-23 09:37
PR 29722 closed miss-islington, 2021-11-23 11:12
PR 29723 open miss-islington, 2021-11-23 11:12
PR 29748 open miss-islington, 2021-11-24 11:57
Messages (2)
msg406829 - (view) Author: Nikita Sobolev (sobolevn) * Date: 2021-11-23 09:32
Right now this test uses `try: ... except TypeError: ...` to ensure that mro is consistent. This has a flaw: code in `try` might not ever raise and this test would still pass.

I will refactor it to use `self.assertRaises` to be 100% sure.
msg406836 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-11-23 11:12
New changeset b48ac6fe38b2fca9963b097c04cdecfc6083104e by Nikita Sobolev in branch 'main':
bpo-45878: convert `try/except` to `self.assertRaises` in `Lib/ctypes/test/test_functions.py` (GH-29721)
https://github.com/python/cpython/commit/b48ac6fe38b2fca9963b097c04cdecfc6083104e
History
Date User Action Args
2021-12-02 22:45:04sobolevnsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-11-24 11:57:49miss-islingtonsetpull_requests: + pull_request27985
2021-11-23 14:28:43AlexWaygoodsetversions: + Python 3.9, Python 3.10, Python 3.11
2021-11-23 11:12:27miss-islingtonsetpull_requests: + pull_request27960
2021-11-23 11:12:26serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg406836
2021-11-23 11:12:22miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27959
2021-11-23 09:37:20sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request27957
2021-11-23 09:32:54sobolevncreate