可否去掉输出前缀的||? · Issue #236 · skywind3000/asyncrun.vim · GitHub
Skip to content

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

Open

Description

@pynbgang

比如目前的运行结果:

: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 _________________________________________________________________________________________________________________

Activity

  1. pinggit commented on Jan 13, 2022

    @pinggit

    同问

  2. skywind3000 commented on Jan 13, 2022

    @skywind3000
    Owner

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

    :AsyncRun -save=1 -mode=term -pos=TAB  pytest
    :AsyncRun -save=1 -mode=term -pos=bottom  pytest
    
  3. pinggit commented on Jan 14, 2022

    @pinggit

    这个-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                                                         
    
  4. skywind3000 commented on Jan 14, 2022

    @skywind3000
    Owner

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

    :AsyncRun -mode=term -pos=termhelp  pytest
    

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

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

  5. pinggit commented on Jan 15, 2022

    @pinggit

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

  6. skywind3000 commented on Jan 16, 2022

    @skywind3000
    Owner

    termhelp 有原始命令的

  7. pinggit commented on Jan 16, 2022

    @pinggit

    我测试的结果:
    :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 =================================================================================
    
    
  8. yehuohan commented on Jun 12, 2023

    @yehuohan

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions