From a9e9b7d749a9fa99f37802f9b0cdaafa930bd8c4 Mon Sep 17 00:00:00 2001 From: mzn Date: Mon, 1 Oct 2018 09:06:06 +0300 Subject: [PATCH] Fix tests using unittest (failed cases were not reported by ctest). --- src/ConstructionAPI/Test/TestAxis.py | 3 ++- src/ConstructionAPI/Test/TestPoint.py | 3 ++- src/ExchangeAPI/Test/TestExchange.py | 3 ++- src/ModelHighAPI/Test/TestDouble.py | 3 ++- src/ModelHighAPI/Test/TestInteger.py | 3 ++- src/ModelHighAPI/Test/TestRefAttr.py | 3 ++- src/ModelHighAPI/Test/TestReference.py | 3 ++- src/ParametersPlugin/Test/TestParameterChangeValue.py | 5 +++-- src/ParametersPlugin/Test/TestParameterRename.py | 5 +++-- src/PythonAPI/Test/TestFeatures.py | 3 ++- src/PythonAPI/Test/TestFeaturesExtrusion.py | 3 ++- src/PythonAPI/Test/TestFeaturesRevolution.py | 3 ++- src/PythonAPI/Test/TestMakeBrick1.py | 3 ++- src/PythonAPI/Test/TestMakeBrick2.py | 3 ++- src/PythonAPI/Test/TestModel.py | 3 ++- src/PythonAPI/Test/TestPlatine.py | 3 ++- src/PythonAPI/Test/TestPrimitivesBox.py | 3 ++- src/PythonAPI/Test/TestPythonAPI.py | 3 ++- src/PythonAPI/Test/TestSketcherAddArc.py | 3 ++- src/PythonAPI/Test/TestSketcherAddCircle.py | 3 ++- src/PythonAPI/Test/TestSketcherAddLine.py | 3 ++- src/PythonAPI/Test/TestSketcherAddPoint.py | 3 ++- src/PythonAPI/Test/TestSketcherSetAngle.py | 3 ++- src/PythonAPI/Test/TestSketcherSetCoincident.py | 3 ++- src/PythonAPI/Test/TestSketcherSetFillet.py | 3 ++- src/PythonAPI/Test/TestSketcherSetHorizontal.py | 3 ++- src/PythonAPI/Test/TestSketcherSetLength.py | 3 ++- src/PythonAPI/Test/TestSketcherSetParallel.py | 3 ++- src/PythonAPI/Test/TestSketcherSetPerpendicular.py | 3 ++- src/PythonAPI/Test/TestSketcherSetRadius.py | 3 ++- src/PythonAPI/Test/TestSketcherSetTangent.py | 3 ++- src/PythonAPI/Test/TestSketcherSetVertical.py | 3 ++- src/SketchAPI/Test/TestSketch.py | 3 ++- src/SketchPlugin/Test/TestConstraintCollinear.py | 5 +++-- src/SketchPlugin/Test/TestFilletInteracting.py | 5 +++-- src/SketchPlugin/Test/TestMoveArc.py | 5 +++-- src/SketchPlugin/Test/TestMoveCircle.py | 5 +++-- src/SketchPlugin/Test/TestMoveLine.py | 5 +++-- src/SketchPlugin/Test/TestMovePoint.py | 5 +++-- 39 files changed, 86 insertions(+), 47 deletions(-) diff --git a/src/ConstructionAPI/Test/TestAxis.py b/src/ConstructionAPI/Test/TestAxis.py index 995577136..b2764e573 100644 --- a/src/ConstructionAPI/Test/TestAxis.py +++ b/src/ConstructionAPI/Test/TestAxis.py @@ -45,4 +45,5 @@ class AxisTestCase(unittest.TestCase): self.assertEqual(100,axis.zDimension().value()) if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/ConstructionAPI/Test/TestPoint.py b/src/ConstructionAPI/Test/TestPoint.py index 185859540..572e78ab8 100644 --- a/src/ConstructionAPI/Test/TestPoint.py +++ b/src/ConstructionAPI/Test/TestPoint.py @@ -55,4 +55,5 @@ class PointTestCase(unittest.TestCase): self.assertEqual("x + 30", point.z().text()) if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/ExchangeAPI/Test/TestExchange.py b/src/ExchangeAPI/Test/TestExchange.py index 94c731faf..06e294a5c 100644 --- a/src/ExchangeAPI/Test/TestExchange.py +++ b/src/ExchangeAPI/Test/TestExchange.py @@ -47,4 +47,5 @@ class ExchangeTestCase(unittest.TestCase): self.session.finishOperation() if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/ModelHighAPI/Test/TestDouble.py b/src/ModelHighAPI/Test/TestDouble.py index 438444b02..00a50f4f5 100644 --- a/src/ModelHighAPI/Test/TestDouble.py +++ b/src/ModelHighAPI/Test/TestDouble.py @@ -35,4 +35,5 @@ class DoubleTestCase(unittest.TestCase): if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/ModelHighAPI/Test/TestInteger.py b/src/ModelHighAPI/Test/TestInteger.py index 26ac7cf62..e27aea8de 100644 --- a/src/ModelHighAPI/Test/TestInteger.py +++ b/src/ModelHighAPI/Test/TestInteger.py @@ -35,4 +35,5 @@ class IntegerTestCase(unittest.TestCase): if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/ModelHighAPI/Test/TestRefAttr.py b/src/ModelHighAPI/Test/TestRefAttr.py index 7706e4a16..56ed4716f 100644 --- a/src/ModelHighAPI/Test/TestRefAttr.py +++ b/src/ModelHighAPI/Test/TestRefAttr.py @@ -56,4 +56,5 @@ class RefAttrTestCase(FeaturesFixture): if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/ModelHighAPI/Test/TestReference.py b/src/ModelHighAPI/Test/TestReference.py index 434583303..976872031 100644 --- a/src/ModelHighAPI/Test/TestReference.py +++ b/src/ModelHighAPI/Test/TestReference.py @@ -52,4 +52,5 @@ class RefAttrTestCase(FeaturesFixture): if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/ParametersPlugin/Test/TestParameterChangeValue.py b/src/ParametersPlugin/Test/TestParameterChangeValue.py index 2da87e4e6..3f9a8bf56 100644 --- a/src/ParametersPlugin/Test/TestParameterChangeValue.py +++ b/src/ParametersPlugin/Test/TestParameterChangeValue.py @@ -175,8 +175,9 @@ class TestParameterRename(unittest.TestCase): self.assertEqual(self.anCircleCentr.y(), 220.) self.assertEqual(self.aRadiusAttr.value(), 200.) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" #========================================================================= # End of test #========================================================================= diff --git a/src/ParametersPlugin/Test/TestParameterRename.py b/src/ParametersPlugin/Test/TestParameterRename.py index c4ba99239..703ee35d1 100644 --- a/src/ParametersPlugin/Test/TestParameterRename.py +++ b/src/ParametersPlugin/Test/TestParameterRename.py @@ -230,8 +230,9 @@ class TestParameterRename(unittest.TestCase): self.assertEqual(self.anCircleCentr.y(), 170.) self.assertEqual(self.aRadiusAttr.value(), 150.) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" #========================================================================= # End of test #========================================================================= diff --git a/src/PythonAPI/Test/TestFeatures.py b/src/PythonAPI/Test/TestFeatures.py index f70dc0355..8c30d92fa 100644 --- a/src/PythonAPI/Test/TestFeatures.py +++ b/src/PythonAPI/Test/TestFeatures.py @@ -111,4 +111,5 @@ class FeaturesTestCase(FeaturesFixture): #----------------------------------------------------------------------------- if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestFeaturesExtrusion.py b/src/PythonAPI/Test/TestFeaturesExtrusion.py index e5f08c70f..45ee4fec3 100644 --- a/src/PythonAPI/Test/TestFeaturesExtrusion.py +++ b/src/PythonAPI/Test/TestFeaturesExtrusion.py @@ -173,4 +173,5 @@ class FeaturesExtrusionTestCase(FeaturesExtrusionFixture): if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestFeaturesRevolution.py b/src/PythonAPI/Test/TestFeaturesRevolution.py index 37a69b386..9b24e9550 100644 --- a/src/PythonAPI/Test/TestFeaturesRevolution.py +++ b/src/PythonAPI/Test/TestFeaturesRevolution.py @@ -206,4 +206,5 @@ class FeaturesRevolutionTestCase(FeaturesRevolutionFixture): if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestMakeBrick1.py b/src/PythonAPI/Test/TestMakeBrick1.py index b5bd7bfef..5e1aa5387 100644 --- a/src/PythonAPI/Test/TestMakeBrick1.py +++ b/src/PythonAPI/Test/TestMakeBrick1.py @@ -23,4 +23,5 @@ import unittest import salome.shaper.examples.MakeBrick1 if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestMakeBrick2.py b/src/PythonAPI/Test/TestMakeBrick2.py index cc681ff09..27f353d8f 100644 --- a/src/PythonAPI/Test/TestMakeBrick2.py +++ b/src/PythonAPI/Test/TestMakeBrick2.py @@ -23,4 +23,5 @@ import unittest import salome.shaper.examples.MakeBrick2 if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestModel.py b/src/PythonAPI/Test/TestModel.py index 5317eeb87..8059037ae 100644 --- a/src/PythonAPI/Test/TestModel.py +++ b/src/PythonAPI/Test/TestModel.py @@ -36,4 +36,5 @@ class ModelTestCase(unittest.TestCase): model.addSketch(self.part, plane) if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestPlatine.py b/src/PythonAPI/Test/TestPlatine.py index dd5b49890..4ac0320ee 100644 --- a/src/PythonAPI/Test/TestPlatine.py +++ b/src/PythonAPI/Test/TestPlatine.py @@ -23,4 +23,5 @@ import unittest import salome.shaper.examples.Platine if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestPrimitivesBox.py b/src/PythonAPI/Test/TestPrimitivesBox.py index c67940670..81dfe1445 100644 --- a/src/PythonAPI/Test/TestPrimitivesBox.py +++ b/src/PythonAPI/Test/TestPrimitivesBox.py @@ -60,4 +60,5 @@ class PrimitivesAddBoxTestCase(PrimitivesAddBox): self.assertEqual(box.secondPoint().context().shape().isVertex(),True) if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestPythonAPI.py b/src/PythonAPI/Test/TestPythonAPI.py index fadc37be7..4919ddcd3 100644 --- a/src/PythonAPI/Test/TestPythonAPI.py +++ b/src/PythonAPI/Test/TestPythonAPI.py @@ -23,4 +23,5 @@ from salome.shaper import model from salome.shaper import geom if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestSketcherAddArc.py b/src/PythonAPI/Test/TestSketcherAddArc.py index 1c3d2278f..7ea8f262d 100644 --- a/src/PythonAPI/Test/TestSketcherAddArc.py +++ b/src/PythonAPI/Test/TestSketcherAddArc.py @@ -55,4 +55,5 @@ class SketcherAddArc(SketcherTestCase): if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestSketcherAddCircle.py b/src/PythonAPI/Test/TestSketcherAddCircle.py index 13ac04202..b1af039f0 100644 --- a/src/PythonAPI/Test/TestSketcherAddCircle.py +++ b/src/PythonAPI/Test/TestSketcherAddCircle.py @@ -42,4 +42,5 @@ class SketcherAddCircle(SketcherTestCase): if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/PythonAPI/Test/TestSketcherAddLine.py b/src/PythonAPI/Test/TestSketcherAddLine.py index e5b021bf7..46aad38f2 100644 --- a/src/PythonAPI/Test/TestSketcherAddLine.py +++ b/src/PythonAPI/Test/TestSketcherAddLine.py @@ -41,4 +41,5 @@ class SketcherAddLine(SketcherTestCase): if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) \ No newline at end of file + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherAddPoint.py b/src/PythonAPI/Test/TestSketcherAddPoint.py index ce6a59a20..1a64f4d94 100644 --- a/src/PythonAPI/Test/TestSketcherAddPoint.py +++ b/src/PythonAPI/Test/TestSketcherAddPoint.py @@ -37,4 +37,5 @@ class SketcherAddPoint(SketcherTestCase): self.assertEqual(point.coordinates().y(), 2.0) if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) \ No newline at end of file + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetAngle.py b/src/PythonAPI/Test/TestSketcherSetAngle.py index 80341e369..f4c914c5c 100644 --- a/src/PythonAPI/Test/TestSketcherSetAngle.py +++ b/src/PythonAPI/Test/TestSketcherSetAngle.py @@ -51,4 +51,5 @@ class SketcherSetAngle(SketcherTestCase): ) if __name__ == "__main__": - unittest.main(exit=False) \ No newline at end of file + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetCoincident.py b/src/PythonAPI/Test/TestSketcherSetCoincident.py index 4ceda3894..b5f613170 100644 --- a/src/PythonAPI/Test/TestSketcherSetCoincident.py +++ b/src/PythonAPI/Test/TestSketcherSetCoincident.py @@ -40,4 +40,5 @@ class SketcherSetCoincident(SketcherTestCase): self.sketch.setCoincident(l1.endPoint()) if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) \ No newline at end of file + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetFillet.py b/src/PythonAPI/Test/TestSketcherSetFillet.py index 52f9e6336..085b6db61 100644 --- a/src/PythonAPI/Test/TestSketcherSetFillet.py +++ b/src/PythonAPI/Test/TestSketcherSetFillet.py @@ -38,4 +38,5 @@ class SketcherSetFillet(SketcherTestCase): model.do() if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) \ No newline at end of file + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetHorizontal.py b/src/PythonAPI/Test/TestSketcherSetHorizontal.py index e5c40aef5..a8d6f8cbf 100644 --- a/src/PythonAPI/Test/TestSketcherSetHorizontal.py +++ b/src/PythonAPI/Test/TestSketcherSetHorizontal.py @@ -30,4 +30,5 @@ class SketcherSetHorizontal(SketcherTestCase): self.assertEqual(line.startPoint().y(), line.endPoint().y()) if __name__ == "__main__": - unittest.main(exit=False) \ No newline at end of file + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetLength.py b/src/PythonAPI/Test/TestSketcherSetLength.py index 233f677b5..5230bd64a 100644 --- a/src/PythonAPI/Test/TestSketcherSetLength.py +++ b/src/PythonAPI/Test/TestSketcherSetLength.py @@ -39,4 +39,5 @@ class SketcherSetLength(SketcherTestCase): self.assertAlmostEqual(length, 25.0, delta=TestSketcher.DELTA) if __name__ == "__main__": - unittest.main(exit=False) \ No newline at end of file + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetParallel.py b/src/PythonAPI/Test/TestSketcherSetParallel.py index 99b78e150..90fe22675 100644 --- a/src/PythonAPI/Test/TestSketcherSetParallel.py +++ b/src/PythonAPI/Test/TestSketcherSetParallel.py @@ -30,4 +30,5 @@ class SketcherSetParallel(SketcherTestCase): model.do() if __name__ == "__main__": - unittest.main(exit=False) \ No newline at end of file + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetPerpendicular.py b/src/PythonAPI/Test/TestSketcherSetPerpendicular.py index b702cb563..8486ae141 100644 --- a/src/PythonAPI/Test/TestSketcherSetPerpendicular.py +++ b/src/PythonAPI/Test/TestSketcherSetPerpendicular.py @@ -38,4 +38,5 @@ class SketcherSetPerpendicular(SketcherTestCase): self.assertAlmostEqual(dot_product, 0.0, delta=TestSketcher.DELTA) if __name__ == "__main__": - unittest.main(exit=False) \ No newline at end of file + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetRadius.py b/src/PythonAPI/Test/TestSketcherSetRadius.py index 37f9540fc..df233b0c4 100644 --- a/src/PythonAPI/Test/TestSketcherSetRadius.py +++ b/src/PythonAPI/Test/TestSketcherSetRadius.py @@ -38,4 +38,5 @@ class SketcherSetRadius(SketcherTestCase): self.assertEqual(circle.radius().value(), 25.0) if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) \ No newline at end of file + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetTangent.py b/src/PythonAPI/Test/TestSketcherSetTangent.py index 127b070ec..18badffd7 100644 --- a/src/PythonAPI/Test/TestSketcherSetTangent.py +++ b/src/PythonAPI/Test/TestSketcherSetTangent.py @@ -41,4 +41,5 @@ class SketcherSetTangent(SketcherTestCase): self.sketch.setTangent(None, self.arc) if __name__ == "__main__": - unittest.main(verbosity=2, exit=False) \ No newline at end of file + test_program = unittest.main(verbosity=2, exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/PythonAPI/Test/TestSketcherSetVertical.py b/src/PythonAPI/Test/TestSketcherSetVertical.py index 76926b3dc..d040e5a8c 100644 --- a/src/PythonAPI/Test/TestSketcherSetVertical.py +++ b/src/PythonAPI/Test/TestSketcherSetVertical.py @@ -30,4 +30,5 @@ class SketcherSetVertical(SketcherTestCase): self.assertEqual(line.startPoint().x(), line.endPoint().x()) if __name__ == "__main__": - unittest.main(exit=False) \ No newline at end of file + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" \ No newline at end of file diff --git a/src/SketchAPI/Test/TestSketch.py b/src/SketchAPI/Test/TestSketch.py index c5cbfa865..fb7c3c019 100644 --- a/src/SketchAPI/Test/TestSketch.py +++ b/src/SketchAPI/Test/TestSketch.py @@ -35,4 +35,5 @@ class SketchTestCase(unittest.TestCase): # TODO(spo): add tests. if __name__ == "__main__": - unittest.main(exit=False) + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/SketchPlugin/Test/TestConstraintCollinear.py b/src/SketchPlugin/Test/TestConstraintCollinear.py index 6f3d2dac5..17cb5cb25 100644 --- a/src/SketchPlugin/Test/TestConstraintCollinear.py +++ b/src/SketchPlugin/Test/TestConstraintCollinear.py @@ -185,8 +185,9 @@ class TestConstraintCollinear(unittest.TestCase): model.do() self.assertEqual(model.dof(self.mySketch), self.myDOF) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" #========================================================================= # End of test #========================================================================= diff --git a/src/SketchPlugin/Test/TestFilletInteracting.py b/src/SketchPlugin/Test/TestFilletInteracting.py index 9eac72b0e..e19574622 100644 --- a/src/SketchPlugin/Test/TestFilletInteracting.py +++ b/src/SketchPlugin/Test/TestFilletInteracting.py @@ -632,5 +632,6 @@ class TestFilletInteracting(unittest.TestCase): model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6]) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/SketchPlugin/Test/TestMoveArc.py b/src/SketchPlugin/Test/TestMoveArc.py index e9f5f73b4..ad78cc063 100644 --- a/src/SketchPlugin/Test/TestMoveArc.py +++ b/src/SketchPlugin/Test/TestMoveArc.py @@ -345,5 +345,6 @@ class TestMoveArc(unittest.TestCase): self.checkPointCoordinates(self.myArc.endPoint(), self.myEnd) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/SketchPlugin/Test/TestMoveCircle.py b/src/SketchPlugin/Test/TestMoveCircle.py index c0ded8ac0..61db0c56c 100644 --- a/src/SketchPlugin/Test/TestMoveCircle.py +++ b/src/SketchPlugin/Test/TestMoveCircle.py @@ -145,5 +145,6 @@ class TestMoveCircle(unittest.TestCase): self.assertAlmostEqual(self.myCircle.radius().value(), self.myRadius) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/SketchPlugin/Test/TestMoveLine.py b/src/SketchPlugin/Test/TestMoveLine.py index fe63ee0f6..d893559f1 100644 --- a/src/SketchPlugin/Test/TestMoveLine.py +++ b/src/SketchPlugin/Test/TestMoveLine.py @@ -132,5 +132,6 @@ class TestMoveLine(unittest.TestCase): self.checkPointCoordinates(self.myLine.endPoint(), self.myEnd) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" diff --git a/src/SketchPlugin/Test/TestMovePoint.py b/src/SketchPlugin/Test/TestMovePoint.py index 2638be12b..5616bd911 100644 --- a/src/SketchPlugin/Test/TestMovePoint.py +++ b/src/SketchPlugin/Test/TestMovePoint.py @@ -104,5 +104,6 @@ class TestMovePoint(unittest.TestCase): self.assertAlmostEqual(self.myPointCoordinates.y(), coord[1]) -if __name__ == '__main__': - unittest.main(exit=False) +if __name__ == "__main__": + test_program = unittest.main(exit=False) + assert test_program.result.wasSuccessful(), "Test failed" -- 2.30.2