Skip to content

Commit

Permalink
test_mesh.py: Use SkipTest
Browse files Browse the repository at this point in the history
  • Loading branch information
wxmerkt committed May 26, 2024
1 parent ba85d7c commit 77b8b21
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions exotica_python/test/test_mesh.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
import unittest

import pyexotica as exo

try:
import trimesh
except ImportError:
import warnings
warnings.warn("trimesh not found, skipping test")
exit()
from nose.plugins.skip import SkipTest

raise SkipTest("trimesh is not available, skipping related tests.")


def validate_mesh(mesh):
print(mesh, mesh.vertex_count, mesh.triangle_count)
assert mesh.vertex_count == 33
assert mesh.triangle_count == 62


class TestPythonMeshCreation(unittest.TestCase):
def test_create_mesh_from_resource_package_path(self):
# Load mesh from resource path
print(">>> Loading STL directly from package-path")
mesh = exo.Mesh.createMeshFromResource("package://exotica_examples/resources/cone.stl")
mesh = exo.Mesh.createMeshFromResource(
"package://exotica_examples/resources/cone.stl"
)
validate_mesh(mesh)

def test_create_mesh_from_resource_exotica_resource_path(self):
Expand Down Expand Up @@ -47,5 +52,6 @@ def teset_create_mesh_from_vertices_and_triangles(self):
mesh = exo.Mesh.createMeshFromVertices(m.vertices, m.faces.flatten())
validate_mesh(mesh)


if __name__ == "__main__":
unittest.main()

0 comments on commit 77b8b21

Please sign in to comment.