Skip to content

Get the test to fail even if coverage is good #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[run]
source = hpack
omit =
hpack/compat.py
hpack/hpack_compat.py

[paths]
source =
h2/
.tox/*/lib/python*/site-packages/h2
.tox/pypy*/site-packages/h2
17 changes: 1 addition & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,8 @@ python:
- "3.5"
- pypy

env:
- NGHTTP2=true
- NGHTTP2=

matrix:
exclude:
- env: NGHTTP2=true
python: pypy

install:
- ".travis/install.sh"
before_script: "flake8 hpack test"
script:
- >
if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then
py.test test/
else
py.test -n 4 --cov hpack test/
coverage report -m --fail-under 100
fi
- ".travis/run.sh"
39 changes: 0 additions & 39 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,6 @@
set -e
set -x

if [[ "$NGHTTP2" = true ]]; then
# GCC 4.6 seems to cause problems, so go straight to 4.8.
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8 libstdc++-4.8-dev
export CXX="g++-4.8" CC="gcc-4.8"
$CC --version

# Install nghttp2. Right now I haven't built a PPA for this so we have to
# do it from source, which kinda sucks. First, install a ton of
# prerequisite packages.
sudo apt-get install autoconf automake autotools-dev libtool pkg-config \
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev \
libevent-dev libjansson-dev libjemalloc-dev
pip install cython

# Now, download and install nghttp2's latest version.
git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
DIR=`pwd`
export PYTHONPATH="$DIR/lib/python${TRAVIS_PYTHON_VERSION}/site-packages"
mkdir -p $PYTHONPATH
autoreconf -i
automake
autoconf
./configure --disable-threads --prefix=`pwd`
make
make install

# The makefile doesn't install into the active virtualenv. Install again.
cd python
python setup.py install
cd ../..

# Let's try ldconfig.
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/libnghttp2.conf'
sudo ldconfig
fi

pip install .
pip install -r test_requirements.txt
pip install flake8
11 changes: 11 additions & 0 deletions .travis/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e
set -x

if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then
py.test test/
else
coverage run -m py.test test/
coverage report -m --fail-under 100
fi
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Release History
===============

dev
---

**API Changes (Backward Incompatible)**

- Removed nghttp2 support. This support had rotted and was essentially
non-functional, so it has now been removed until someone has time to re-add
the support in a functional form.

2.3.0 (2016-08-04)
------------------

Expand Down
107 changes: 0 additions & 107 deletions hpack/hpack_compat.py

This file was deleted.

17 changes: 0 additions & 17 deletions test/test_hpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
)
from hpack.struct import HeaderTuple, NeverIndexedHeaderTuple
import itertools
import os
import pytest

from hypothesis import given
Expand Down Expand Up @@ -772,19 +771,3 @@ def _prepend_colon(k):

assert expected_special == received_special
assert expected_boring == received_boring


class TestUtilities(object):
def test_nghttp2_installs_correctly(self):
# This test is a debugging tool: if nghttp2 is being tested by Travis,
# we need to confirm it imports correctly. Hyper will normally hide the
# import failure, so let's discover it here.
# Alternatively, if we are *not* testing with nghttp2, this test should
# confirm that it's not available.
if os.environ.get('NGHTTP2'):
import nghttp2
else:
with pytest.raises(ImportError):
import nghttp2 # noqa

assert True
3 changes: 1 addition & 2 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pytest==2.9.2
pytest-xdist==1.14
pytest-cov==2.3.1
hypothesis==3.4.2
coverage==4.2.0