-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Update assert.rst #12742
Update assert.rst #12742
Conversation
pytest 8.3.2 Python 3.12.1 os : Window 10 Enterprise
Should be verified on Linux also . Test fails on Window 10 but has not been verified on Linux |
@@ -112,7 +112,7 @@ If you want to check if a block of code is raising an exact exception type, you | |||
foo() | |||
assert excinfo.type is RuntimeError | |||
|
|||
The :func:`pytest.raises` call will succeed, even though the function raises :class:`NotImplementedError`, because | |||
The :func:`pytest.raises` call will fail, even though the function raises :class:`NotImplementedError`, eventhough |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Eventhough" is not a valid word in English
And it's incorrect to say the pytest.raises call fails
I'm afraid I can't make sense of this at all. Those changes both are unneeded and in fact incorrect, but I'm confused as your description/comment ("Should be verified on Linux also . Test fails on Window 10 but has not been verified on Linux") seems to be entirely unrelated to what you're changing (a simple doc update, without any code involved). Can you elaborate? |
Yes I can. The test case fails as it gives the below error when you run it on window 10 see below console output
test_foo_not_implemented.py F [100%] ====================================================== FAILURES =======================================================
E AssertionError: assert <class 'NotImplementedError'> is RuntimeError test_foo_not_implemented.py:8: AssertionError The "test_foo_not_implemented.py" is as below which is copied from the documentation:
|
Ah the example code is incorrect, but the wording is correct |
Line 113 should be |
No, both the text and the code are correct. The whole point of that example is that this fails, as explained right there...
|
Ah yes indeed |
The code should be changed from . Otherwise the assertion statement fails. Please reconsider the code change |
Yes, it fails. That's the whole point, as explained in the text around it. |
pytest 8.3.2
Python 3.12.1
os : Window 10 Enterprise