Skip to content

Instantly share code, notes, and snippets.

@jmwright
Last active November 3, 2024 22:16
Show Gist options
  • Save jmwright/f9cac09685b26ab6712c2db526756fbc to your computer and use it in GitHub Desktop.
Save jmwright/f9cac09685b26ab6712c2db526756fbc to your computer and use it in GitHub Desktop.
$ pytest
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.11.10, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/jwright/repos/cadquery
collected 628 items
tests/test_assembly.py ............................................................................................ [ 14%]
tests/test_cad_objects.py ....................................... [ 20%]
tests/test_cadquery.py ...................................................................................................................................................................................................F. [ 52%]
tests/test_cqgi.py .................. [ 55%]
tests/test_examples.py ........................................................................................ [ 69%]
tests/test_exporters.py ............................................F...... [ 77%]
tests/test_free_functions.py ............................... [ 82%]
tests/test_hull.py .. [ 82%]
tests/test_importers.py ...... [ 83%]
tests/test_jupyter.py .. [ 83%]
tests/test_selectors.py ............................................ [ 90%]
tests/test_shapes.py ... [ 91%]
tests/test_sketch.py .................................. [ 96%]
tests/test_utils.py . [ 96%]
tests/test_vis.py . [ 96%]
tests/test_workplanes.py ................... [100%]
================================================================================================================== FAILURES ==================================================================================================================
__________________________________________________________________________________________________________ TestCadQuery.test_toVtk ___________________________________________________________________________________________________________
self = <tests.test_cadquery.TestCadQuery testMethod=test_toVtk>
def test_toVtk(self):
from vtkmodules.vtkCommonDataModel import vtkPolyData
f = Face.makePlane(2, 2)
vtk = f.toVtkPolyData(normals=False)
assert isinstance(vtk, vtkPolyData)
> assert vtk.GetNumberOfPolys() == 2
E assert 0 == 2
E + where 0 = <built-in method GetNumberOfPolys of vtkmodules.vtkCommonDataModel.vtkPolyData object at 0x7fb097ab0be0>()
E + where <built-in method GetNumberOfPolys of vtkmodules.vtkCommonDataModel.vtkPolyData object at 0x7fb097ab0be0> = <vtkmodules.vtkCommonDataModel.vtkPolyData(0x55cd6f0d0880) at 0x7fb097ab0be0>.GetNumberOfPolys
tests/test_cadquery.py:5695: AssertionError
------------------------------------------------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------------------------------------------------
2024-11-03 17:10:49.827 ( 11.455s) [ E1379500]vtkDemandDrivenPipeline:661 ERR| vtkCompositeDataPipeline (0x55cd6f135ce0): Input port 0 of algorithm vtkTriangleFilter (0x55cd6fa852d0) has 0 connections but is not optional.
___________________________________________________________________________________________________________ test_assy_vtk_rotation ___________________________________________________________________________________________________________
tmpdir = PosixPath('/tmp/pytest-of-jwright/pytest-0/out1')
def test_assy_vtk_rotation(tmpdir):
v0 = Vertex.makeVertex(1, 0, 0)
assy = Assembly()
assy.add(
v0, name="v0", loc=Location(Vector(0, 0, 0), Vector(1, 0, 0), 90),
)
fwrl = Path(tmpdir, "v0.wrl")
assert not fwrl.exists()
assy.save(str(fwrl), "VRML")
assert fwrl.exists()
matched_rot = False
with open(fwrl) as f:
pat_rot = re.compile("""rotation 1 0 0 1.5707963267""")
for line in f:
if m := re.search(pat_rot, line):
matched_rot = True
break
> assert matched_rot
E assert False
tests/test_exporters.py:841: AssertionError
------------------------------------------------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------------------------------------------------
2024-11-03 17:10:54.461 ( 16.089s) [ E1379500]vtkDemandDrivenPipeline:661 ERR| vtkCompositeDataPipeline (0x55cd6f70c220): Input port 0 of algorithm vtkTriangleFilter (0x55cd6f5f56e0) has 0 connections but is not optional.
============================================================================================================== warnings summary ==============================================================================================================
tests/test_assembly.py: 30 warnings
tests/test_exporters.py: 10 warnings
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: save will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
tests/test_assembly.py: 11 warnings
/home/jwright/repos/cadquery/tests/test_assembly.py:712: DeprecationWarning: pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-op
with tmpdir:
tests/test_assembly.py::test_export_vtkjs
/home/jwright/repos/cadquery/tests/test_assembly.py:719: DeprecationWarning: pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-op
with tmpdir:
tests/test_cad_objects.py::TestCadObjects::testCompoundCenter
tests/test_cadquery.py::TestCadQuery::testCombineSolidsInLoop
tests/test_cadquery.py::TestCadQuery::testCubePlugin
tests/test_cadquery.py::TestCadQuery::testCylinderPlugin
tests/test_cadquery.py::TestCadQuery::testDoubleTwistedLoft
tests/test_examples.py::test_example[73]
tests/test_examples.py::test_example[74]
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: combineSolids will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
tests/test_cadquery.py::TestCadQuery::testFindFace
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: findFace will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
tests/test_cadquery.py::TestCadQuery::testIntersect
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: __and__ will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
tests/test_cadquery.py::TestCadQuery::testText
/home/jwright/repos/cadquery/cadquery/utils.py:66: FutureWarning: Kwarg <cut> will be removed. Please use <combine='cut'>
warn(
tests/test_cadquery.py::TestCadQuery::testUnions
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: __or__ will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
tests/test_cadquery.py::TestCadQuery::test_interpPlate
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: interpPlate will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
tests/test_exporters.py::TestExporters::test3MF
tests/test_exporters.py::TestExporters::testAMF
tests/test_exporters.py::TestExporters::testSTEP
tests/test_exporters.py::TestExporters::testSTL
tests/test_exporters.py::TestExporters::testSVG
tests/test_exporters.py::TestExporters::testSVGOptions
tests/test_exporters.py::TestExporters::testTJS
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: exportShape will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
tests/test_exporters.py::TestExporters::testSTEP
tests/test_exporters.py::TestExporters::testSTL
/home/jwright/repos/cadquery/cadquery/utils.py:39: FutureWarning: readAndDeleteFile will be removed in the next release.
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================================================== short test summary info ===========================================================================================================
FAILED tests/test_cadquery.py::TestCadQuery::test_toVtk - assert 0 == 2
FAILED tests/test_exporters.py::test_assy_vtk_rotation - assert False
================================================================================================ 2 failed, 626 passed, 73 warnings in 20.02s =================================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment