skywind3000/asyncrun.vim

可否去掉输出前缀的||?

Opened this issue · 8 comments

比如目前的运行结果:

:AsyncRun -save=1 -focus=1 pytest

可否在下列输出中去掉前缀的两个竖线?

|| [pytest]
|| ============================================================================================================= test session starts =============================================================================================================
|| platform linux -- Python 3.8.5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
|| rootdir: /test_pytest
|| plugins: f5-sdk-3.0.21
|| collected 5 items
|| 
|| test_sample.py F..FF                                                                                                                                                                                                                    [100%]
|| 
|| ================================================================================================================== FAILURES ===================================================================================================================
|| _________________________________________________________________________________________________________________ test_answer _________________________________________________________________________________________________________________

同问

没法去,这是 vim 的 quickfix 窗口,你可以试试终端模式:

:AsyncRun -save=1 -mode=term -pos=TAB  pytest
:AsyncRun -save=1 -mode=term -pos=bottom  pytest

这个-mode=term是可以的,输出没有||前缀。
但是发现另外一个小问题。
对比qfix窗口,term的输出缺少了输出对应的原始命令行,这个还是不太方便 - 一大堆输出是来自哪个命令现在没有了记录。。。
这个能加进来吗?

|| [pytest test_compare.py::test_greater -v]
|| ================================================================================================ test session starts ================================================================================================
|| platform linux -- Python 3.8.5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
|| cachedir: .pytest_cache
|| rootdir: /mnt/c/Users/pings/Dropbox/python/learning_python/pytest_test
|| plugins: f5-sdk-3.0.21, forked-1.4.0, xdist-2.5.0
|| collecting ... collected 1 item                                                                                                                                                                      
========================== test session starts ===========================
platform linux -- Python 3.8.5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /
usr/bin/python3
cachedir: .pytest_cache
rootdir: /mnt/c/Users/pings/Dropbox/python/learning_python/pytest_test
plugins: f5-sdk-3.0.21, forked-1.4.0, xdist-2.5.0
collected 1 item                                                         

你可以安装 https://github.com/skywind3000/vim-terminal-help 用这个插件作为 runner,然后

:AsyncRun -mode=term -pos=termhelp  pytest

这样你既能够看到原始命令,又避免了 ||

这个插件的终端还可以用 alt+= 进行打开、关闭切换。

我试了下,没有看到区别。。。

termhelp 有原始命令的

我测试的结果:
:AsyncRun -save=1 -focus=1 -cwd=$(VIM_FILEDIR) -mode=term -pos=termhelp pytest % -v

无论有没有安装termhelp, 都如同vim内置terminal的结果。没有看到原始命令阿?
如果安装了termhelp, 我alt+=测试时能够显示termhelp窗口的,所以确实是安装了的。。。

================================================================================ test session starts ================================================================================
platform linux -- Python 3.8.5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /mnt/c/Users/pings/Dropbox/python/learning_python/pytest_test/book_code/ch1
plugins: f5-sdk-3.0.21, forked-1.4.0, xdist-2.5.0
collected 1 item                                                                                                                                                                    

test_two.py::test_failing FAILED                                                                                                                                              [100%]

===================================================================================== FAILURES ======================================================================================
___________________________________________________________________________________ test_failing ____________________________________________________________________________________

    def test_failing():
>       assert (1, 2, 3) == (3, 2, 1)
E       assert (1, 2, 3) == (3, 2, 1)
E         At index 0 diff: 1 != 3
E         Full diff:
E         - (3, 2, 1)
E         ?  ^     ^
E         + (1, 2, 3)
E         ?  ^     ^

test_two.py:2: AssertionError
============================================================================== short test summary info ==============================================================================
FAILED test_two.py::test_failing - assert (1, 2, 3) == (3, 2, 1)
================================================================================= 1 failed in 0.19s =================================================================================

我也遇到了这个问题,发现可以通过 syntax match wsdQuickfix /\m^|| / conceal 隐藏