From 7d171951367d39c76cbaf0259271a176902a8d0f Mon Sep 17 00:00:00 2001 From: mcbarton Date: Fri, 24 Jan 2025 19:32:18 +0000 Subject: [PATCH] Apply PR suggestion --- test/test_api.py | 4 ++-- test/test_concurrent.py | 2 +- test/test_cpp11features.py | 2 +- test/test_crossinheritance.py | 14 +++++++------- test/test_doc_features.py | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/test_api.py b/test/test_api.py index 5d8b3223..24509945 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -64,7 +64,7 @@ class APICheck2 { m2 = API.Instance_FromVoidPtr(voidp, 'APICheck2') assert m is m2 - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test04_custom_converter(self): """Custom type converter""" @@ -143,7 +143,7 @@ class APICheck3Converter : public CPyCppyy::Converter { assert type(gA3b) == cppyy.gbl.APICheck3 assert not gA3b.wasFromMemoryCalled() - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test05_custom_executor(self): """Custom type executor""" diff --git a/test/test_concurrent.py b/test/test_concurrent.py index e82ee3a1..5d74d0cd 100644 --- a/test/test_concurrent.py +++ b/test/test_concurrent.py @@ -166,7 +166,7 @@ def process(self, c): assert "RuntimeError" in w.err_msg assert "all wrong" in w.err_msg - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test05_float2d_callback(self): """Passing of 2-dim float arguments""" diff --git a/test/test_cpp11features.py b/test/test_cpp11features.py index 28b10140..f1089eac 100644 --- a/test/test_cpp11features.py +++ b/test/test_cpp11features.py @@ -15,7 +15,7 @@ def setup_class(cls): import cppyy cls.cpp11features = cppyy.load_reflection_info(cls.test_dct) - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test01_smart_ptr(self): """Usage and access of std::shared/unique_ptr<>""" diff --git a/test/test_crossinheritance.py b/test/test_crossinheritance.py index d4a76939..0fc245f4 100644 --- a/test/test_crossinheritance.py +++ b/test/test_crossinheritance.py @@ -36,7 +36,7 @@ def get_value(self): assert Base1.call_get_value(Base1()) == 42 assert Base1.call_get_value(Derived()) == 13 - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test02_constructor(self): """Test constructor usage for derived classes""" @@ -73,7 +73,7 @@ def get_value(self): assert d.get_value() == 29 assert Base1.call_get_value(d) == 29 - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test03_override_function_abstract_base(self): """Test ability to override a simple function with an abstract base""" @@ -166,7 +166,7 @@ def pass_value5(self, b): d2 = Derived2() assert Base1.sum_pass_value(d2) == 12+4*d2.m_int - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test05_override_overloads(self): """Test ability to override overloaded functions""" @@ -187,7 +187,7 @@ def sum_all(self, *args): assert d.sum_all(-7, -5) == 1 assert Base1.call_sum_all(d, -7, -5) == 1 - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test06_const_methods(self): """Declared const methods should keep that qualifier""" @@ -210,7 +210,7 @@ def __init__(self): assert CX.IBase4.call_get_value(c1) == 17 assert CX.IBase4.call_get_value(c2) == 27 - @mark.xfail(run=not (IS_LINUX_ARM), reason="Fails with ModuleNotFound error") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Fails with ModuleNotFound error") def test07_templated_base(self): """Derive from a base class that is instantiated from a template""" @@ -511,7 +511,7 @@ def __init__(self): assert m.get_data() == 42 assert m.get_data_v() == 42 - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test15_object_returns(self): """Return of C++ objects from overridden functions""" @@ -746,7 +746,7 @@ class Derived(ns.Base): def abstract1(self): return ns.Result(1) - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test20_basic_multiple_inheritance(self): """Basic multiple inheritance""" diff --git a/test/test_doc_features.py b/test/test_doc_features.py index 335e861e..b350829e 100644 --- a/test/test_doc_features.py +++ b/test/test_doc_features.py @@ -1106,7 +1106,7 @@ def test_template_instantiation(self): assert len(v) == 10 assert [m.fData for m in v] == list(range(10)) - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test_cross_inheritance(self): """Cross-inheritance example""" @@ -1146,7 +1146,7 @@ def add(self, i): assert v.back().add(17) == 4+42+2*17 - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test_fallbacks(self): """Template instantation switches based on value sizes""" @@ -1165,7 +1165,7 @@ def test_fallbacks(self): assert CC.passT(2**64-1) == 2**64-1 assert 'unsigned long long' in CC.passT.__doc__ - @mark.xfail(run=not (IS_LINUX_ARM), reason="Crashes pytest on Linux ARM") + @mark.xfail(run=False, condition=IS_LINUX_ARM, reason="Crashes pytest on Linux ARM") def test_callbacks(self): """Function callback example"""