Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bukzor committed Nov 17, 2014
1 parent e1e9391 commit 58f994d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ exclude_lines =
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b

# Don't complain if tests don't hit re-raise of unexpected errors:
^\s*raise$

# Don't complain if non-runnable code isn't run:
Expand Down
4 changes: 1 addition & 3 deletions .travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ SITEPACKAGES=${SITEPACKAGES:-.}
PROJECT=venv_update
NCPU=$(getconf _NPROCESSORS_CONF)

export PYTHONPATH=$(readlink -f $SITEPACKAGES)

python --version
coverage --version
py.test --version
Expand All @@ -15,4 +13,4 @@ py.test -n $NCPU \
--cov-enable --cov-config=$TOP/.coveragerc --cov-report='' \
"$@" $TOP/tests $SITEPACKAGES/${PROJECT}.py
coverage combine
coverage report --fail-under 75 # FIXME: should be 100
coverage report --rcfile=$TOP/.coveragerc --fail-under 95 # FIXME: should be 100
7 changes: 5 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ Should probably do before it hits users

* currently if you get your arguments backwards, your requirements get deleted, replaced with empty dir. this is bad

* coverage: 37-38, 47-50, 86-99, 116-151, 156-162, 170-176, 192-198, 209, 211, 213, 218-221
* coverage: 32-33, 46, 50, 53, 72, 78-80, 99, 104-112, 156-162, 168-176, 185-188, 198, 208-221, 54->57
* coverage: 50, 99, 198, 209, 211, 213, 218-221, 47->50, 54->57, 97->99, 192->198


Things that I want to do, but would put me past my deadline:

* On ubuntu stock python2.7 I have to rm -rf $VIRTUAL_ENV/local
to avoid the AssertionError('unexpected third case')
https://bitbucket.org/ned/coveragepy/issue/340/keyerror-subpy

* I could remove the --cov-config with a small patch to pytest-cov
use os.path.abspath(options.cov_config) in postprocess(options)

Expand Down
1 change: 1 addition & 0 deletions requirements.d/dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# minimal set of packages for committers
-e ..
-r test.txt
-r _lint.txt
tox
1 change: 0 additions & 1 deletion requirements.d/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
pytest-xdist
pytest-timeout
pytest-rerunfailures

2 changes: 1 addition & 1 deletion tests/functional/help_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def test_help(capfd):
assert HELP_OUTPUT
assert HELP_OUTPUT.startswith('usage:')
last_line = HELP_OUTPUT.rsplit('\n', 2)[-2].strip()
assert last_line.startswith('-h, --help ')
assert last_line.startswith('Version control at: http')

venv_update('--help')
out, err = capfd.readouterr()
Expand Down
6 changes: 3 additions & 3 deletions venv_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
To set the index server, export a PIP_INDEX_SERVER variable.
See also: http://pip.readthedocs.org/en/latest/user_guide.html#environment-variables
Version control at: https://github.com/yelp/venv-update
positional arguments:
virtualenv_dir Destination virtualenv directory (default: virtualenv_run)
requirements Requirements files. (default: requirements.txt)
optional arguments:
-h, --help show this help message and exit
Version control at: https://github.com/yelp/venv-update
'''
from __future__ import print_function
from __future__ import unicode_literals
Expand Down Expand Up @@ -195,7 +195,7 @@ def venv_update(stage, venv_path, reqs, venv_args):
# we're activated into the venv we want, and there should be nothing but pip and setuptools installed.
return do_install(reqs)
else:
raise ValueError('unexpected stage value: %r' % stage)
raise AssertionError('impossible stage value: %r' % stage)


def main():
Expand Down

0 comments on commit 58f994d

Please sign in to comment.