mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 10:54:22 +08:00
Report coverage (#863)
This commit is contained in:
5
.coveragerc
Normal file
5
.coveragerc
Normal file
@@ -0,0 +1,5 @@
|
||||
[run]
|
||||
branch = 1
|
||||
|
||||
[report]
|
||||
include = pythonx/jedi_*.py,test/*
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@
|
||||
doc/tags
|
||||
.pytest-cache
|
||||
build
|
||||
.coverage*
|
||||
|
||||
14
.travis.yml
14
.travis.yml
@@ -5,7 +5,11 @@ env:
|
||||
matrix:
|
||||
- ENV=test
|
||||
- ENV=check
|
||||
- ENV=test_nvim
|
||||
- ENV=test_coverage
|
||||
matrix:
|
||||
include:
|
||||
- env: ENV=test_coverage
|
||||
python: 2.7
|
||||
install:
|
||||
- |
|
||||
if [ "$ENV" = "test" ]; then
|
||||
@@ -13,12 +17,16 @@ install:
|
||||
fi
|
||||
- |
|
||||
# https://github.com/neovim/bot-ci#generated-builds
|
||||
if [ "$ENV" = "test_nvim" ]; then
|
||||
if [ "$ENV" = "test_coverage" ]; then
|
||||
eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) nightly-x64"
|
||||
pip --version
|
||||
pip install neovim
|
||||
pip install neovim pytest-cov
|
||||
else
|
||||
vim --version
|
||||
fi
|
||||
script:
|
||||
- make --keep-going "$ENV"
|
||||
|
||||
after_success:
|
||||
- coverage xml
|
||||
- bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -X fix -X search -X xcode -f coverage.xml -F py${TRAVIS_PYTHON_VERSION//./}
|
||||
|
||||
3
Makefile
3
Makefile
@@ -4,6 +4,9 @@ test:
|
||||
test_nvim:
|
||||
VSPEC_VIM=nvim pytest test_*.py
|
||||
|
||||
test_coverage: export PYTEST_ADDOPTS:=--cov pythonx --cov test --cov-report=term-missing:skip-covered
|
||||
test_coverage: test_nvim
|
||||
|
||||
build:
|
||||
mkdir $@
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import os
|
||||
import subprocess
|
||||
import urllib.request
|
||||
try:
|
||||
from urllib.request import urlretrieve
|
||||
except ImportError:
|
||||
from urllib import urlretrieve
|
||||
import zipfile
|
||||
|
||||
import pytest
|
||||
@@ -47,7 +50,7 @@ def pytest_configure(config):
|
||||
os.mkdir(CACHE_FOLDER)
|
||||
|
||||
if not os.path.exists(VSPEC_FOLDER):
|
||||
name, hdrs = urllib.request.urlretrieve(VSPEC_URL)
|
||||
name, hdrs = urlretrieve(VSPEC_URL)
|
||||
z = zipfile.ZipFile(name)
|
||||
for n in z.namelist():
|
||||
dest = os.path.join(CACHE_FOLDER, n)
|
||||
|
||||
@@ -10,6 +10,7 @@ describe 'documentation docstrings'
|
||||
end
|
||||
|
||||
it 'simple'
|
||||
Expect maparg('K') == ':call jedi#show_documentation()<CR>'
|
||||
put = 'ImportError'
|
||||
normal GK
|
||||
Expect bufname('%') == "__doc__"
|
||||
|
||||
8
test/vimrc
Normal file
8
test/vimrc
Normal file
@@ -0,0 +1,8 @@
|
||||
" Minimal vimrc to use jedi-vim.
|
||||
"
|
||||
" Not used anywhere yet, but allows for easy testing.
|
||||
let script_dir = fnamemodify(expand('<sfile>'), ':h:h')
|
||||
let &runtimepath = script_dir.','.&runtimepath.','.script_dir.'/after'
|
||||
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
Reference in New Issue
Block a user