Skip to content

Commit

Permalink
Mark tests that currently fail on GraalPy with xfail
Browse files Browse the repository at this point in the history
  • Loading branch information
msimacek committed Sep 20, 2024
1 parent a00b51e commit 61a0f8e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_cpp_conduit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import home_planet_very_lonely_traveler
import pytest

import env # noqa: F401
from pybind11_tests import cpp_conduit as home_planet


Expand All @@ -20,6 +21,7 @@ def test_premium_traveler_getattr_actually_exists():
assert t_h.secret_name == "PremiumTraveler GetAttr: secret_name points: 7"


@pytest.mark.xfail("env.GRAALPY", reason="TODO should get fixed on GraalPy side")
def test_call_cpp_conduit_success():
t_h = home_planet.Traveler("home")
cap = t_h._pybind11_conduit_v1_(
Expand Down
3 changes: 3 additions & 0 deletions tests/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

import pytest

import env # noqa: F401
from pybind11_tests import enums as m


@pytest.mark.xfail("env.GRAALPY", reason="TODO should get fixed on GraalPy side")
def test_unscoped_enum():
assert str(m.UnscopedEnum.EOne) == "UnscopedEnum.EOne"
assert str(m.UnscopedEnum.ETwo) == "UnscopedEnum.ETwo"
Expand Down Expand Up @@ -193,6 +195,7 @@ def test_implicit_conversion():
assert repr(x) == "{<EMode.EFirstMode: 1>: 3, <EMode.ESecondMode: 2>: 4}"


@pytest.mark.xfail("env.GRAALPY", reason="TODO should get fixed on GraalPy side")
def test_binary_operators():
assert int(m.Flags.Read) == 4
assert int(m.Flags.Write) == 2
Expand Down
3 changes: 3 additions & 0 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def test_custom(msg):
assert msg(excinfo.value) == "[PythonMyException7]: abc"


@pytest.mark.xfail("env.GRAALPY", reason="TODO should get fixed on GraalPy side")
def test_nested_throws(capture):
"""Tests nested (e.g. C++ -> Python -> C++) exception handling"""

Expand Down Expand Up @@ -369,13 +370,15 @@ def _test_flaky_exception_failure_point_init_py_3_12():
"env.PYPY and sys.version_info[:2] < (3, 12)",
reason="PyErr_NormalizeException Segmentation fault",
)
@pytest.mark.xfail("env.GRAALPY", reason="TODO should be fixed on GraalPy side")
def test_flaky_exception_failure_point_init():
if sys.version_info[:2] < (3, 12):
_test_flaky_exception_failure_point_init_before_py_3_12()
else:
_test_flaky_exception_failure_point_init_py_3_12()


@pytest.mark.xfail("env.GRAALPY", reason="TODO should be fixed on GraalPy side")
def test_flaky_exception_failure_point_str():
what, py_err_set_after_what = m.error_already_set_what(
FlakyException, ("failure_point_str",)
Expand Down
20 changes: 20 additions & 0 deletions tests/test_gil_scoped.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ def _run_in_threads(test_fn, num_threads, parallel):

@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_one_thread(test_fn):
"""Makes sure there is no GIL deadlock when running in a thread.
Expand All @@ -221,6 +226,11 @@ def test_run_in_process_one_thread(test_fn):

@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_multiple_threads_parallel(test_fn):
"""Makes sure there is no GIL deadlock when running in a thread multiple times in parallel.
Expand All @@ -231,6 +241,11 @@ def test_run_in_process_multiple_threads_parallel(test_fn):

@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_multiple_threads_sequential(test_fn):
"""Makes sure there is no GIL deadlock when running in a thread multiple times sequentially.
Expand All @@ -241,6 +256,11 @@ def test_run_in_process_multiple_threads_sequential(test_fn):

@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_direct(test_fn):
"""Makes sure there is no GIL deadlock when using processes.
Expand Down
3 changes: 3 additions & 0 deletions tests/test_operator_overloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import pytest

import env # noqa: F401
from pybind11_tests import ConstructorStats
from pybind11_tests import operators as m


@pytest.mark.xfail("env.GRAALPY", reason="TODO should get fixed on GraalPy side")
def test_operator_overloading():
v1 = m.Vector2(1, 2)
v2 = m.Vector(3, -1)
Expand Down Expand Up @@ -83,6 +85,7 @@ def test_operator_overloading():
assert cstats.move_assignments == 0


@pytest.mark.xfail("env.GRAALPY", reason="TODO should get fixed on GraalPy side")
def test_operators_notimplemented():
"""#393: need to return NotSupported to ensure correct arithmetic operator behavior"""

Expand Down
2 changes: 2 additions & 0 deletions tests/test_pytypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def __repr__(self):
m.str_from_std_string_input,
],
)
@pytest.mark.xfail("env.GRAALPY", reason="TODO should be fixed on GraalPy side")
def test_surrogate_pairs_unicode_error(func):
input_str = "\ud83d\ude4f".encode("utf-8", "surrogatepass")
with pytest.raises(UnicodeDecodeError):
Expand Down Expand Up @@ -420,6 +421,7 @@ def test_accessor_moves():
pytest.skip("Not defined: PYBIND11_HANDLE_REF_DEBUG")


@pytest.mark.xfail("env.GRAALPY", reason="TODO should be fixed on GraalPy side")
def test_constructors():
"""C++ default and converting constructors are equivalent to type calls in Python"""
types = [bytes, bytearray, str, bool, int, float, tuple, list, dict, set]
Expand Down

0 comments on commit 61a0f8e

Please sign in to comment.