Skip to content
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

fix(tests): failing tests on python3.13 about stacktrace messages #578

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions test/test_vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import sys
import tempfile
import textwrap
from pathlib import Path

import pytest
Expand Down Expand Up @@ -232,21 +231,16 @@ def test_python3_ex_eval(vim: Nvim) -> None:
# because the Ex command :python will throw (wrapped with provider#python3#Call)
with pytest.raises(NvimError) as excinfo:
vim.command('py3= 1/0')
assert textwrap.dedent('''\
Traceback (most recent call last):
File "<string>", line 1, in <module>
ZeroDivisionError: division by zero
''').strip() in excinfo.value.args[0]
stacktrace = excinfo.value.args[0]
assert 'File "<string>", line 1, in <module>' in stacktrace
assert 'ZeroDivisionError: division by zero' in stacktrace

vim.command('python3 def raise_error(): raise RuntimeError("oops")')
with pytest.raises(NvimError) as excinfo:
vim.command_output('python3 =print("nooo", raise_error())')
assert textwrap.dedent('''\
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 1, in raise_error
RuntimeError: oops
''').strip() in excinfo.value.args[0]
stacktrace = excinfo.value.args[0]
assert 'File "<string>", line 1, in raise_error' in stacktrace
assert 'RuntimeError: oops' in stacktrace
assert 'nooo' not in vim.command_output(':messages')


Expand Down
Loading