|
3 | 3 | import os
|
4 | 4 | import sys
|
5 | 5 | import tempfile
|
6 |
| -import textwrap |
7 | 6 | from pathlib import Path
|
8 | 7 |
|
9 | 8 | import pytest
|
@@ -232,21 +231,16 @@ def test_python3_ex_eval(vim: Nvim) -> None:
|
232 | 231 | # because the Ex command :python will throw (wrapped with provider#python3#Call)
|
233 | 232 | with pytest.raises(NvimError) as excinfo:
|
234 | 233 | vim.command('py3= 1/0')
|
235 |
| - assert textwrap.dedent('''\ |
236 |
| - Traceback (most recent call last): |
237 |
| - File "<string>", line 1, in <module> |
238 |
| - ZeroDivisionError: division by zero |
239 |
| - ''').strip() in excinfo.value.args[0] |
| 234 | + stacktrace = excinfo.value.args[0] |
| 235 | + assert 'File "<string>", line 1, in <module>' in stacktrace |
| 236 | + assert 'ZeroDivisionError: division by zero' in stacktrace |
240 | 237 |
|
241 | 238 | vim.command('python3 def raise_error(): raise RuntimeError("oops")')
|
242 | 239 | with pytest.raises(NvimError) as excinfo:
|
243 | 240 | vim.command_output('python3 =print("nooo", raise_error())')
|
244 |
| - assert textwrap.dedent('''\ |
245 |
| - Traceback (most recent call last): |
246 |
| - File "<string>", line 1, in <module> |
247 |
| - File "<string>", line 1, in raise_error |
248 |
| - RuntimeError: oops |
249 |
| - ''').strip() in excinfo.value.args[0] |
| 241 | + stacktrace = excinfo.value.args[0] |
| 242 | + assert 'File "<string>", line 1, in raise_error' in stacktrace |
| 243 | + assert 'RuntimeError: oops' in stacktrace |
250 | 244 | assert 'nooo' not in vim.command_output(':messages')
|
251 | 245 |
|
252 | 246 |
|
|
0 commit comments