aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/python.vim
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-11-30 12:08:46 +0100
committerChristian Clason <ch.clason+github@icloud.com>2024-11-30 13:40:08 +0100
commit9d174a7dace3004a069f474ed9c8ba4f3b97c5d8 (patch)
treeaf831f22f553d19f7af7ad01b0176e936b231d93 /runtime/ftplugin/python.vim
parent4426a326e2441326e280a0478f83128e09305806 (diff)
downloadrneovim-9d174a7dace3004a069f474ed9c8ba4f3b97c5d8.tar.gz
rneovim-9d174a7dace3004a069f474ed9c8ba4f3b97c5d8.tar.bz2
rneovim-9d174a7dace3004a069f474ed9c8ba4f3b97c5d8.zip
vim-patch:9.1.0898: runtime(compiler): pytest compiler not included
Problem: runtime(compiler): pytest compiler not included Solution: include pytest compiler, update the compiler completion test (Konfekt) closes: vim/vim#16130 https://github.com/vim/vim/commit/3c2596a9e967910143d41fbb9615614ab36d43a7 Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Diffstat (limited to 'runtime/ftplugin/python.vim')
-rw-r--r--runtime/ftplugin/python.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim
index c000296726..6f20468896 100644
--- a/runtime/ftplugin/python.vim
+++ b/runtime/ftplugin/python.vim
@@ -3,8 +3,9 @@
" Maintainer: Tom Picton <tom@tompicton.com>
" Previous Maintainer: James Sully <sullyj3@gmail.com>
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
-" Last Change: 2024/05/13
-" https://github.com/tpict/vim-ftplugin-python
+" Repository: https://github.com/tpict/vim-ftplugin-python
+" Last Change: 2024/05/13
+" 2024 Nov 30 use pytest compiler (#16130)
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
@@ -134,6 +135,11 @@ elseif executable('python')
setlocal keywordprg=python\ -m\ pydoc
endif
+if expand('%:t') =~# '\v^test_.*\.py$|_test\.py$' && executable('pytest')
+ compiler pytest
+ let &l:makeprg .= ' %:S'
+endif
+
" Script for filetype switching to undo the local stuff we may have changed
let b:undo_ftplugin = 'setlocal cinkeys<'
\ . '|setlocal comments<'
@@ -148,6 +154,7 @@ let b:undo_ftplugin = 'setlocal cinkeys<'
\ . '|setlocal softtabstop<'
\ . '|setlocal suffixesadd<'
\ . '|setlocal tabstop<'
+ \ . '|setlocal makeprg<'
\ . '|silent! nunmap <buffer> [M'
\ . '|silent! nunmap <buffer> [['
\ . '|silent! nunmap <buffer> []'