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

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

Open
pynbgang opened this issue Jan 13, 2022 · 8 comments
Open

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

pynbgang opened this issue Jan 13, 2022 · 8 comments

Comments

@pynbgang
Copy link

pynbgang commented Jan 13, 2022

比如目前的运行结果:

: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 _________________________________________________________________________________________________________________
@pinggit
Copy link

pinggit commented Jan 13, 2022

同问

@skywind3000
Copy link
Owner

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

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

@pinggit
Copy link

pinggit commented Jan 14, 2022

这个-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                                                         

@skywind3000
Copy link
Owner

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

:AsyncRun -mode=term -pos=termhelp  pytest

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

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

@pinggit
Copy link

pinggit commented Jan 15, 2022

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

@skywind3000
Copy link
Owner

termhelp 有原始命令的

@pinggit
Copy link

pinggit commented Jan 16, 2022

我测试的结果:
: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 =================================================================================

@yehuohan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants