Skip to content

Commit

Permalink
Report coverage (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed authored Jul 30, 2018
1 parent b33392c commit 8850289
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[run]
branch = 1

[report]
include = pythonx/jedi_*.py,test/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
doc/tags
.pytest-cache
build
.coverage*
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,28 @@ 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
python3.6 -m pip install pytest
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 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@

Expand Down
7 changes: 5 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions test/documentation.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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__"
Expand Down
8 changes: 8 additions & 0 deletions test/vimrc
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8850289

Please sign in to comment.