Skip to content

Commit 84e657b

Browse files
authored
Merge pull request #1248 from hroncok/hyp6.6
Workaround the issues with hypothesis 6.6
2 parents 8ab1e61 + 64d10a2 commit 84e657b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

test/test_basic_logic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from . import helpers
2323

24-
from hypothesis import given
24+
from hypothesis import given, settings, HealthCheck
2525
from hypothesis.strategies import integers
2626

2727

@@ -790,6 +790,7 @@ def test_headers_are_lowercase(self, frame_factory):
790790
assert c.data_to_send() == expected_frame.serialize()
791791

792792
@given(frame_size=integers(min_value=2**14, max_value=(2**24 - 1)))
793+
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
793794
def test_changing_max_frame_size(self, frame_factory, frame_size):
794795
"""
795796
When the user changes the max frame size and the change is ACKed, the

test/test_flow_control_window.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88
import pytest
99

10-
from hypothesis import given
10+
from hypothesis import given, settings, HealthCheck
1111
from hypothesis.strategies import integers
1212

1313
import h2.config
@@ -715,6 +715,7 @@ def _setup_connection_and_send_headers(self, frame_factory):
715715
return c
716716

717717
@given(stream_id=integers(max_value=0))
718+
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
718719
def test_must_acknowledge_for_stream(self, frame_factory, stream_id):
719720
"""
720721
Flow control acknowledgements must be done on a stream ID that is
@@ -740,6 +741,7 @@ def test_must_acknowledge_for_stream(self, frame_factory, stream_id):
740741
)
741742

742743
@given(size=integers(max_value=-1))
744+
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
743745
def test_cannot_acknowledge_less_than_zero(self, frame_factory, size):
744746
"""
745747
The user must acknowledge at least 0 bytes.
@@ -837,6 +839,7 @@ def test_acknowledging_streams_we_never_saw(self, frame_factory):
837839
c.acknowledge_received_data(2048, stream_id=101)
838840

839841
@given(integers(min_value=1025, max_value=DEFAULT_FLOW_WINDOW))
842+
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
840843
def test_acknowledging_1024_bytes_when_empty_increments(self,
841844
frame_factory,
842845
increment):
@@ -873,6 +876,7 @@ def test_acknowledging_1024_bytes_when_empty_increments(self,
873876
# This test needs to use a lower cap, because otherwise the algo will
874877
# increment the stream window anyway.
875878
@given(integers(min_value=1025, max_value=(DEFAULT_FLOW_WINDOW // 4) - 1))
879+
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
876880
def test_connection_only_empty(self, frame_factory, increment):
877881
"""
878882
If the connection flow control window is empty, but the stream flow
@@ -916,6 +920,7 @@ def test_connection_only_empty(self, frame_factory, increment):
916920
assert c.data_to_send() == expected_data
917921

918922
@given(integers(min_value=1025, max_value=DEFAULT_FLOW_WINDOW))
923+
@settings(suppress_health_check=[HealthCheck.function_scoped_fixture])
919924
def test_mixing_update_forms(self, frame_factory, increment):
920925
"""
921926
If the user mixes ackowledging data with manually incrementing windows,

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ deps =
1616
pytest>=6.0.1,<7
1717
pytest-cov>=2.10.1,<3
1818
pytest-xdist>=2.0.0,<3
19-
hypothesis>=5.5,<6
19+
hypothesis>=5.5,<7
2020
commands =
2121
pytest --cov-report=xml --cov-report=term --cov=h2 {posargs}
2222

0 commit comments

Comments
 (0)