Skip to content

Avoid uppercase ASCII labels in hostname strategies - #205

Open
Aminark wants to merge 1 commit into
python-hyper:masterfrom
Aminark:fix/avoid-uppercase-hostname-labels
Open

Aminark wants to merge 1 commit into
python-hyper:masterfrom
Aminark:fix/avoid-uppercase-hostname-labels

Conversation

@Aminark

@Aminark Aminark commented Oct 25, 2026

Copy link
Copy Markdown

Fixes #186.

hostname_labels(allow_idn=False) draws uppercase letters, but idna.check_label rejects them. The wasted samples make the existing ASCII-label and hostname tests fail Hypothesis's filter_too_much health check.

Draw lowercase ASCII letters instead. Uppercase labels could not get past validation before, so the set of returned labels stays the same. No health checks are disabled.

The unmodified code fails all three ASCII strategy tests with the seed from #186. After the change, all 135 tests and doctests pass on Python 3.9 with the pinned pytest 5.2.4/Hypothesis 5.8.6/idna 2.9 dependencies, and on Python 3.12 with Hypothesis 6.170.9 (two seeds). The prescribed Black 21.7b0, Flake8 3.9.2, and mypy 0.910 checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests are failing due to hypothesis filtering

1 participant