-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
when I try to compare numbers I get "IndexError: list index out of range" #85
Comments
I think this is an issue with windows paths and multiple drive letters. |
Nope. Not a path thing. I’m working on a fix. |
This should be fixed by version 1.0.7. Please check. |
I use the version 1.0.7. But still getting the error >>> import pytest_check as check
>>> check.greater(1, 2)
Traceback (most recent call last):
File "C:\Users\ZL\AppData\Local\Programs\Python\Python310\lib\site-packages\pytest_check\check_methods.py", line 84, in wrapper
func(*args, **kwds)
File "C:\Users\ZL\AppData\Local\Programs\Python\Python310\lib\site-packages\pytest_check\check_methods.py", line 175, in greater
assert a > b, msg
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ZL\AppData\Local\Programs\Python\Python310\lib\site-packages\pytest_check\check_methods.py", line 89, in wrapper
log_failure(e)
File "C:\Users\ZL\AppData\Local\Programs\Python\Python310\lib\site-packages\pytest_check\check_methods.py", line 304, in log_failure
(file, line, func, context) = get_full_context(level)
File "C:\Users\ZL\AppData\Local\Programs\Python\Python310\lib\site-packages\pytest_check\check_methods.py", line 292, in get_full_context
(_, filename, line, funcname, contextlist) = inspect.stack()[level][0:5]
IndexError: list index out of range |
Can you include a full toy example? And full output including Python and pytest version you’re using? |
Sorry. Obvious that you’re using Python 3.10. But what version of pytest? And an example to test with would help. |
Python version:3.10.2 Sorry, I used pytest check in interactive console. >>> import pytest_check as check
>>> check.greater(1, 2) When run with pytest, it is fine. import pytest_check as check
import pytest
cases = [
(1, 2),
(2, 2)
]
@pytest.mark.parametrize("a, b", cases)
def test_compare(a, b):
check.greater(a, b)
check.less(a, b)
check.equal(a, b)
check.not_equal(a, b) |
Ah! This helps a ton. I have a fix I think should work. I'll try to get it published this evening. |
Could you try this against version 1.0.8? |
@zerocen or test with 1.0.9. :) |
when I try to compare:
pytest_check.greater(1, 2)
I get:
Traceback (most recent call last):
File "D:\Project\autotest_vm\venv\lib\site-packages\pytest_check\check_methods.py", line 84, in wrapper
func(*args, **kwds)
File "D:\Project\autotest_vm\venv\lib\site-packages\pytest_check\check_methods.py", line 175, in greater
assert a > b, msg
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Project\autotest_vm\3.py", line 2, in
pytest_check.greater(1, 2)
File "D:\Project\autotest_vm\venv\lib\site-packages\pytest_check\check_methods.py", line 89, in wrapper
log_failure(e)
File "D:\Project\autotest_vm\venv\lib\site-packages\pytest_check\check_methods.py", line 304, in log_failure
(file, line, func, context) = get_full_context(level)
File "D:\Project\autotest_vm\venv\lib\site-packages\pytest_check\check_methods.py", line 292, in get_full_context
(_, filename, line, funcname, contextlist) = inspect.stack()[level][0:5]
IndexError: list index out of range
Why i getting "During handling of the above exception, another exception occurred"
The text was updated successfully, but these errors were encountered: