Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 3319074

Browse files
committed
Better nghttp2 test.
1 parent 070dd9b commit 3319074

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/test_hyper.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,14 +2003,19 @@ def test_splitting_repeated_headers(self):
20032003

20042004
assert expected == split_repeated_headers(test_headers)
20052005

2006-
@pytest.mark.skipif(not os.environ.get('NGHTTP2'), reason="No nghttp2")
20072006
def test_nghttp2_installs_correctly(self):
20082007
# This test is a debugging tool: if nghttp2 is being tested by Travis,
20092008
# we need to confirm it imports correctly. Hyper will normally hide the
20102009
# import failure, so let's discover it here.
2011-
import nghttp2
2012-
assert True
2010+
# Alternatively, if we are *not* testing with nghttp2, this test should
2011+
# confirm that it's not available.
2012+
if os.environ.get('NGHTTP2'):
2013+
import nghttp2
2014+
else:
2015+
with pytest.raises(ImportError):
2016+
import nghttp2
20132017

2018+
assert True
20142019

20152020
# Some utility classes for the tests.
20162021
class NullEncoder(object):

0 commit comments

Comments
 (0)