Skip to content

Commit

Permalink
Disable running hypothesis tests under cibuildwheel (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 12, 2024
1 parent ca035aa commit 33bb5ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/reusable-build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ jobs:
with:
platforms: all
id: qemu

- name: Add wheel type to environment
run: |
echo "CIBW_TYPE=${{ inputs.os }}-${{ inputs.qemu }}" >> "${GITHUB_ENV}"
shell: bash

- name: Prepare emulation
if: inputs.qemu
run: |
Expand Down
8 changes: 8 additions & 0 deletions tests/test_quoting.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from typing import Type

import pytest
Expand All @@ -8,6 +9,8 @@
from yarl._quoting_py import _Quoter as _PyQuoter
from yarl._quoting_py import _Unquoter as _PyUnquoter

IS_CIBUILDWHEEL = bool(os.getenv("CIBW_TYPE"))

if not NO_EXTENSIONS:
from yarl._quoting_c import _Quoter as _CQuoter
from yarl._quoting_c import _Unquoter as _CUnquoter
Expand Down Expand Up @@ -471,12 +474,14 @@ def test_unquoter_path_with_plus(unquoter):


@given(safe=st.text(), protected=st.text(), qs=st.booleans(), requote=st.booleans())
@pytest.mark.skipif(IS_CIBUILDWHEEL, reason="This test is too slow for cibuildwheel.")
def test_fuzz__PyQuoter(safe, protected, qs, requote):
"""Verify that _PyQuoter can be instantiated with any valid arguments."""
assert _PyQuoter(safe=safe, protected=protected, qs=qs, requote=requote)


@given(ignore=st.text(), unsafe=st.text(), qs=st.booleans())
@pytest.mark.skipif(IS_CIBUILDWHEEL, reason="This test is too slow for cibuildwheel.")
def test_fuzz__PyUnquoter(ignore, unsafe, qs):
"""Verify that _PyUnquoter can be instantiated with any valid arguments."""
assert _PyUnquoter(ignore=ignore, unsafe=unsafe, qs=qs)
Expand All @@ -488,6 +493,7 @@ def test_fuzz__PyUnquoter(ignore, unsafe, qs):
alphabet=st.characters(max_codepoint=127, blacklist_characters="%")
),
)
@pytest.mark.skipif(IS_CIBUILDWHEEL, reason="This test is too slow for cibuildwheel.")
@pytest.mark.parametrize("quoter", quoters, ids=quoter_ids)
@pytest.mark.parametrize("unquoter", unquoters, ids=unquoter_ids)
def test_quote_unquote_parameter(
Expand All @@ -509,6 +515,7 @@ def test_quote_unquote_parameter(
alphabet=st.characters(max_codepoint=127, blacklist_characters="%")
),
)
@pytest.mark.skipif(IS_CIBUILDWHEEL, reason="This test is too slow for cibuildwheel.")
@pytest.mark.parametrize("quoter", quoters, ids=quoter_ids)
@pytest.mark.parametrize("unquoter", unquoters, ids=unquoter_ids)
def test_quote_unquote_parameter_requote(
Expand All @@ -530,6 +537,7 @@ def test_quote_unquote_parameter_requote(
alphabet=st.characters(max_codepoint=127, blacklist_characters="%")
),
)
@pytest.mark.skipif(IS_CIBUILDWHEEL, reason="This test is too slow for cibuildwheel.")
@pytest.mark.parametrize("quoter", quoters, ids=quoter_ids)
@pytest.mark.parametrize("unquoter", unquoters, ids=unquoter_ids)
def test_quote_unquote_parameter_path_safe(
Expand Down

0 comments on commit 33bb5ee

Please sign in to comment.