From 44e3d01d2dcd345f2f668e8ee0f5f7741a97931f Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Fri, 8 Nov 2024 08:50:50 -0500 Subject: [PATCH 1/3] test: enable test_settings_matching_names --- tests/test_flobject.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_flobject.py b/tests/test_flobject.py index 6e18db0b350..e2435f005e6 100644 --- a/tests/test_flobject.py +++ b/tests/test_flobject.py @@ -860,7 +860,6 @@ def test_settings_wild_card_access(new_solver_session) -> None: ) -@pytest.mark.skip("https://github.com/ansys/pyfluent/issues/2792") @pytest.mark.fluent_version("latest") def test_settings_matching_names(new_solver_session) -> None: solver = new_solver_session @@ -873,9 +872,10 @@ def test_settings_matching_names(new_solver_session) -> None: with pytest.raises(AttributeError) as msg: solver.setup.mod - assert ( - msg.value.args[0] == "'setup' object has no attribute 'mod'.\n" - "The most similar names are: models." + assert msg.value.args[0].startswith( + "'setup' object has no attribute 'mod'.\n\n" + "The most similar API names are:\n" + "setup.models (Object)" ) with pytest.raises(ValueError) as msg: @@ -886,10 +886,6 @@ def test_settings_matching_names(new_solver_session) -> None: "The most similar names are: k-epsilon." ) - energy_parent = solver.setup._get_parent_of_active_child_names("energy") - - assert energy_parent == "\n energy is a child of models \n" - @pytest.mark.codegen_required @pytest.mark.fluent_version(">=23.2") From ce55ec23f21caf916e6248aa87eb78de4f9d3780 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Fri, 8 Nov 2024 11:56:00 -0500 Subject: [PATCH 2/3] fix: Correct Fluent version --- tests/test_flobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_flobject.py b/tests/test_flobject.py index e2435f005e6..33042d2fdca 100644 --- a/tests/test_flobject.py +++ b/tests/test_flobject.py @@ -860,7 +860,7 @@ def test_settings_wild_card_access(new_solver_session) -> None: ) -@pytest.mark.fluent_version("latest") +@pytest.mark.fluent_version(">=25.1") def test_settings_matching_names(new_solver_session) -> None: solver = new_solver_session From 8b03693699cc5b1b3078e9ac2b8a8b2893d54424 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Tue, 7 Jan 2025 20:01:07 -0500 Subject: [PATCH 3/3] test: fix --- tests/test_flobject.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_flobject.py b/tests/test_flobject.py index 33042d2fdca..9207f6baeb6 100644 --- a/tests/test_flobject.py +++ b/tests/test_flobject.py @@ -873,11 +873,11 @@ def test_settings_matching_names(new_solver_session) -> None: solver.setup.mod assert msg.value.args[0].startswith( - "'setup' object has no attribute 'mod'.\n\n" - "The most similar API names are:\n" - "setup.models (Object)" + "'setup' object has no attribute 'mod'.\n\n" "The most similar API names are:\n" ) + assert len(msg.value.args[0].split("\n")) > 5 + with pytest.raises(ValueError) as msg: solver.setup.models.viscous.model = "k_epsilon"