From 1d85c547a525a6c746d130d49e270931d46c2f38 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Tue, 10 Dec 2024 00:53:42 +0100 Subject: [PATCH 1/2] bump pybind11_json to 0.2.15 and remove one test skip given a segfault was fixed. closes #319 --- gitmodules/pybind11_json | 2 +- tests/test_aero_mode.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gitmodules/pybind11_json b/gitmodules/pybind11_json index b02a2ad5..32043f43 160000 --- a/gitmodules/pybind11_json +++ b/gitmodules/pybind11_json @@ -1 +1 @@ -Subproject commit b02a2ad597d224c3faee1f05a56d81d4c4453092 +Subproject commit 32043f433ed987b2c2ce99d689ec337bcbd4ba95 diff --git a/tests/test_aero_mode.py b/tests/test_aero_mode.py index 1e0b1c18..daa90e51 100644 --- a/tests/test_aero_mode.py +++ b/tests/test_aero_mode.py @@ -291,16 +291,20 @@ def test_ctor_fails_with_nonunique_mass_fracs(): assert str(exc_info.value) == "mass_frac keys must be unique" @staticmethod - def test_segfault_case(): # TODO #319 - pytest.skip() - + def test_fixed_segfault_case_on_circular_reference(): + # arrange aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL) fishy_ctor_arg = copy.deepcopy(AERO_MODE_CTOR_LOG_NORMAL) fishy_ctor_arg["test_mode"]["mass_frac"].append( fishy_ctor_arg["test_mode"]["mass_frac"] ) - print(fishy_ctor_arg) - ppmc.AeroMode(aero_data, fishy_ctor_arg) + + # act + with pytest.raises(TypeError) as exc_info: + ppmc.AeroMode(aero_data, fishy_ctor_arg) + + # assert + assert "incompatible constructor arguments" in str(exc_info.value) @staticmethod @pytest.mark.skipif(platform.machine() == "arm64", reason="TODO #348") From 4cc22e830af5e27fe585adcf69d6365f0da63d3a Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Tue, 10 Dec 2024 08:11:51 +0100 Subject: [PATCH 2/2] add skip for ARM64 --- tests/test_aero_mode.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_aero_mode.py b/tests/test_aero_mode.py index daa90e51..e8526640 100644 --- a/tests/test_aero_mode.py +++ b/tests/test_aero_mode.py @@ -291,6 +291,7 @@ def test_ctor_fails_with_nonunique_mass_fracs(): assert str(exc_info.value) == "mass_frac keys must be unique" @staticmethod + @pytest.mark.skipif(platform.machine() == "arm64", reason="TODO #348") def test_fixed_segfault_case_on_circular_reference(): # arrange aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)