diff --git a/examples/loft.py b/examples/loft.py index 12046720..628b5afe 100644 --- a/examples/loft.py +++ b/examples/loft.py @@ -41,7 +41,11 @@ top_bottom = art.faces().filter_by(GeomType.PLANE) offset(openings=top_bottom, amount=0.5) -assert abs(art.part.volume - 1306.3405290344635) < 1e-3 +want = 1306.3405290344635 +got = art.part.volume +delta = abs(got - want) +tolerance = 1e-3 +assert delta < tolerance, f'{delta=} is greater than {tolerance=}; {got=}, {want=}' show(art, names=["art"]) # [End] diff --git a/tests/test_examples.py b/tests/test_examples.py index 71abbb82..32515007 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -57,7 +57,7 @@ def assert_example_does_not_raise(self): [ sys.executable, "-c", - f"exec(open('{mock_ocp_vscode}').read()); exec(read_and_absolutify('{path}'))", + f"exec(open(r'{mock_ocp_vscode}').read()); exec(read_and_absolutify('{path}'))", ], capture_output=True, cwd=tmpdir,