Blob Blame History Raw
From 0edafe4d3951b5d07012bce0a66dd78efac1c50a Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawar.s.rajput@gmail.com>
Date: Sat, 19 Mar 2022 22:59:43 +0530
Subject: [PATCH] fix (test): Fixes to doctest return 0 on failure

Bitten by https://stackoverflow.com/questions/18782721/doctest-failed-with-zero-exit-code
---
 tests/test_api.py | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tests/test_api.py b/tests/test_api.py
index 3ffe1ab4..3a222d8d 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -19,7 +19,7 @@ def test_rectangles():
     panel PanelShape.tri  0 0 0 1 1 1 1 3 -10 t1
     panel PanelShape.sph  0 -10 0 3 10 10 s1
     panel PanelShape.cyl  20 30 70 20 50 70 4 20 20 cyl1
-    panel PanelShape.disk  20 20 20 10 10 20 20 d1
+    panel PanelShape.disk  20 20 20 10 10 20 20 10 d1
     """
     r1 = S.Rectangle((0, 10, 1), dimensions=(10, 20), axis="+x", name="A")
     print(r1.toText())
@@ -27,13 +27,22 @@ def test_rectangles():
     print(tr.toText())
     sph = S.Sphere(center=[0, -10, 0], radius=3, slices=10, stacks=10, name="s1")
     print(sph.toText())
-    cyl = S.Cylinder(start=[20, 30, 70], end=[20, 50, 70], radius=4, slices=20,stacks=20, name="cyl1")
+    cyl = S.Cylinder(
+        start=[20, 30, 70],
+        end=[20, 50, 70],
+        radius=4,
+        slices=20,
+        stacks=20,
+        name="cyl1",
+    )
     print(cyl.toText())
-    disk = S.Disk(center=[20, 20, 20], radius=10, vector=[10, 20, 20], slices=10, name="d1")
+    disk = S.Disk(
+        center=[20, 20, 20], radius=10, vector=[10, 20, 20], slices=10, name="d1"
+    )
     print(disk.toText())
 
 
 if __name__ == "__main__":
     import doctest
 
-    doctest.testmod()
+    doctest.testmod(raise_on_error=True)