From 33bb5ee1a0cce73ae91a3c9fbc8b8de6914b9ebb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 12 Oct 2024 16:22:44 -0500 Subject: [PATCH] Disable running hypothesis tests under cibuildwheel (#1238) --- .github/workflows/reusable-build-wheel.yml | 6 ++++++ tests/test_quoting.py | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/reusable-build-wheel.yml b/.github/workflows/reusable-build-wheel.yml index 284954429..a27288113 100644 --- a/.github/workflows/reusable-build-wheel.yml +++ b/.github/workflows/reusable-build-wheel.yml @@ -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: | diff --git a/tests/test_quoting.py b/tests/test_quoting.py index 1f9cba6aa..bea987b1f 100644 --- a/tests/test_quoting.py +++ b/tests/test_quoting.py @@ -1,3 +1,4 @@ +import os from typing import Type import pytest @@ -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 @@ -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) @@ -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( @@ -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( @@ -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(