Skip to content

Commit

Permalink
Added skip for unit tests that fail when running AEDT with COM (#3953)
Browse files Browse the repository at this point in the history
* added skip for unit test that will fail with com

* fixed spelling
  • Loading branch information
Alberto-DM authored Dec 7, 2023
1 parent 2811961 commit aa36100
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _unittest/test_03_Materials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os

from _unittest.conftest import config
from _unittest.conftest import local_path
import pytest

Expand Down Expand Up @@ -269,6 +270,7 @@ def test_12_material_model(self):
self.aedtapp["$df"] = 0.01
assert mat.set_djordjevic_sarkar_model(dk="$dk", df="$df")

@pytest.mark.skipif(not config["use_grpc"], reason="Not running in COM mode")
def test_13_get_materials_in_project(self):
used_materials = self.aedtapp.materials.get_used_project_material_names()
assert isinstance(used_materials, list)
Expand Down
2 changes: 2 additions & 0 deletions _unittest/test_05_Mesh.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _unittest.conftest import config
from _unittest.conftest import desktop_version
import pytest

Expand Down Expand Up @@ -102,6 +103,7 @@ def test_04_assign_surface_priority(self):
== "High"
)

@pytest.mark.skipif(not config["use_grpc"], reason="Not running in COM mode")
def test_05_delete_mesh_ops(self):
assert self.aedtapp.mesh.delete_mesh_operations("surface")
assert len(self.aedtapp.mesh.meshoperation_names) == 2
Expand Down
1 change: 1 addition & 0 deletions _unittest/test_28_Maxwell3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ def test_52_assign_flux_tangential(self):
assert self.aedtapp.assign_flux_tangential(box.faces[0], "FluxExample")
assert self.aedtapp.assign_flux_tangential(box.faces[0].id, "FluxExample")

@pytest.mark.skipif(not config["use_grpc"], reason="Not running in COM mode")
@pytest.mark.skipif(desktop_version < "2023.2", reason="Method available in beta from 2023.2")
def test_53_assign_layout_force(self, layout_comp):
nets_layers = {
Expand Down
1 change: 1 addition & 0 deletions _unittest/test_41_3dlayout_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ def test_41_test_create_polygon(self):
assert p2.name == "poly_test_41_void"
assert not self.aedtapp.modeler.create_polygon_void("Top", points2, "another_object", name="poly_43_void")

@pytest.mark.skipif(not config["use_grpc"], reason="Not running in COM mode")
@pytest.mark.skipif(config["desktopVersion"] < "2023.2", reason="Working only from 2023 R2")
def test_42_post_processing(self, add_app):
test_post1 = add_app(project_name=test_post, application=Maxwell3d, subfolder=test_subfolder)
Expand Down
3 changes: 3 additions & 0 deletions _unittest/test_98_Icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ def test_49_delete_monitors(self):
assert self.aedtapp.monitor.all_monitors == {}
assert not self.aedtapp.monitor.delete_monitor("Test")

@pytest.mark.skipif(not config["use_grpc"], reason="Not running in COM mode")
def test_50_advanced3dcomp_export(self):
self.aedtapp.insert_design("advanced3dcompTest")
surf1 = self.aedtapp.modeler.create_rectangle(self.aedtapp.PLANE.XY, [0, 0, 0], [10, 20], name="surf1")
Expand Down Expand Up @@ -713,6 +714,7 @@ def test_50_advanced3dcomp_export(self):
surf1.delete()
fan_obj_3d.delete()

@pytest.mark.skipif(not config["use_grpc"], reason="Not running in COM mode")
def test_51_advanced3dcomp_import(self):
self.aedtapp.insert_design("test_3d_comp")
surf1 = self.aedtapp.modeler.create_rectangle(self.aedtapp.PLANE.XY, [0, 0, 0], [10, 20], name="surf1")
Expand Down Expand Up @@ -814,6 +816,7 @@ def test_51_advanced3dcomp_import(self):
comp_file=os.path.join(file_path, file_name), targetCS="Global", auxiliary_dict=False, name="test"
)

@pytest.mark.skipif(not config["use_grpc"], reason="Not running in COM mode")
def test_52_flatten_3d_components(self):
self.aedtapp.insert_design("test_52")
cs2 = self.aedtapp.modeler.create_coordinate_system(name="CS2")
Expand Down

0 comments on commit aa36100

Please sign in to comment.