Report coverage (#863)

This commit is contained in:
Daniel Hahler
2018-07-30 22:45:06 +02:00
committed by GitHub
parent b33392c8c8
commit 88502891ba
7 changed files with 34 additions and 5 deletions

5
.coveragerc Normal file
View File

@@ -0,0 +1,5 @@
[run]
branch = 1
[report]
include = pythonx/jedi_*.py,test/*

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@
doc/tags doc/tags
.pytest-cache .pytest-cache
build build
.coverage*

View File

@@ -5,7 +5,11 @@ env:
matrix: matrix:
- ENV=test - ENV=test
- ENV=check - ENV=check
- ENV=test_nvim - ENV=test_coverage
matrix:
include:
- env: ENV=test_coverage
python: 2.7
install: install:
- | - |
if [ "$ENV" = "test" ]; then if [ "$ENV" = "test" ]; then
@@ -13,12 +17,16 @@ install:
fi fi
- | - |
# https://github.com/neovim/bot-ci#generated-builds # 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" eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) nightly-x64"
pip --version pip --version
pip install neovim pip install neovim pytest-cov
else else
vim --version vim --version
fi fi
script: script:
- make --keep-going "$ENV" - 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//./}

View File

@@ -4,6 +4,9 @@ test:
test_nvim: test_nvim:
VSPEC_VIM=nvim pytest test_*.py 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: build:
mkdir $@ mkdir $@

View File

@@ -1,6 +1,9 @@
import os import os
import subprocess import subprocess
import urllib.request try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
import zipfile import zipfile
import pytest import pytest
@@ -47,7 +50,7 @@ def pytest_configure(config):
os.mkdir(CACHE_FOLDER) os.mkdir(CACHE_FOLDER)
if not os.path.exists(VSPEC_FOLDER): if not os.path.exists(VSPEC_FOLDER):
name, hdrs = urllib.request.urlretrieve(VSPEC_URL) name, hdrs = urlretrieve(VSPEC_URL)
z = zipfile.ZipFile(name) z = zipfile.ZipFile(name)
for n in z.namelist(): for n in z.namelist():
dest = os.path.join(CACHE_FOLDER, n) dest = os.path.join(CACHE_FOLDER, n)

View File

@@ -10,6 +10,7 @@ describe 'documentation docstrings'
end end
it 'simple' it 'simple'
Expect maparg('K') == ':call jedi#show_documentation()<CR>'
put = 'ImportError' put = 'ImportError'
normal GK normal GK
Expect bufname('%') == "__doc__" Expect bufname('%') == "__doc__"

8
test/vimrc Normal file
View 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