-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add else: fail()
to test cases where exception is always expected
#120544
Comments
sobolevn
added
type-bug
An unexpected behavior, bug, or error
tests
Tests in the Lib/test dir
labels
Jun 15, 2024
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Jun 15, 2024
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Jun 15, 2024
sobolevn
added a commit
that referenced
this issue
Jun 15, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 15, 2024
…ted (pythonGH-120545) (cherry picked from commit 42ebdd8) Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 15, 2024
…ted (pythonGH-120545) (cherry picked from commit 42ebdd8) Co-authored-by: Nikita Sobolev <[email protected]>
mrahtz
pushed a commit
to mrahtz/cpython
that referenced
this issue
Jun 30, 2024
noahbkim
pushed a commit
to hudson-trading/cpython
that referenced
this issue
Jul 11, 2024
estyxx
pushed a commit
to estyxx/cpython
that referenced
this issue
Jul 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Most
except self.failureClass
cases haveelse
branch where we can ensure that the exception really did happen:cpython/Lib/test/test_unittest/test_case.py
Lines 831 to 837 in d4039d3
But, some rare ones do not have them:
cpython/Lib/test/test_unittest/test_case.py
Lines 1148 to 1154 in d4039d3
So, in theory they can just succeed and
except
branch might never be called. This is a theorical problem, but it is still a problem.I propose to add
else
branches to these tests, just to be safe.Linked PRs
else: fail()
to tests where exception is expected #120545else: fail()
to tests where exception is expected (GH-120545) #120546else: fail()
to tests where exception is expected (GH-120545) #120547The text was updated successfully, but these errors were encountered: