Skip to content

Failed to detect and use pytest compiler plugin with command python3 -m pytest #360

Description

@Bekaboo

Context: I am using vim-dispatch with vim-test to run tests asynchronously with the correct compiler plugin.

In most cases, it works fluently, e.g., for Go files, vim-test will generate a test command go test ... and vim-dispatch will use my after/compiler/gotest.vim plugin to get the errorformat, then populate the quickfix list correctly.

For Python with Pytest as test framework, vim-test uses python -m pytest ... instead of pytest ... (related PR: vim-test/vim-test#608), which seems to confuse vim-dispatch as it does not set the compiler plugin to pytest and pytest's output is not correctly populated to the quickfix list. This can be further verified with:

  • echo dispatch#compiler_for_program('python3 -m pytest tests/test_server.py') -> ""
  • echo dispatch#compiler_for_program('pytest tests/test_server.py') -> "pytest"

Could we improve the heuristic logic for pytest?

Activity

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