From: Matthias Maier Date: Sat, 8 Jul 2023 04:40:45 +0000 (-0500) Subject: PythonWrappers: fall back to Release if Debug is unavailable X-Git-Tag: relicensing~716^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15652%2Fhead;p=dealii.git PythonWrappers: fall back to Release if Debug is unavailable --- diff --git a/contrib/python-bindings/tests/cell_accessor_wrapper.py b/contrib/python-bindings/tests/cell_accessor_wrapper.py index 826170380f..0f82379016 100644 --- a/contrib/python-bindings/tests/cell_accessor_wrapper.py +++ b/contrib/python-bindings/tests/cell_accessor_wrapper.py @@ -14,7 +14,11 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestCellAccessorWrapper(unittest.TestCase): diff --git a/contrib/python-bindings/tests/manifold_wrapper.py b/contrib/python-bindings/tests/manifold_wrapper.py index 3ce9ef7cd0..98b2c0bc29 100644 --- a/contrib/python-bindings/tests/manifold_wrapper.py +++ b/contrib/python-bindings/tests/manifold_wrapper.py @@ -16,7 +16,11 @@ import math import os import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestManifoldWrapperShell(unittest.TestCase): diff --git a/contrib/python-bindings/tests/mapping_wrapper.py b/contrib/python-bindings/tests/mapping_wrapper.py index 4f403d091f..7094242bdf 100644 --- a/contrib/python-bindings/tests/mapping_wrapper.py +++ b/contrib/python-bindings/tests/mapping_wrapper.py @@ -14,7 +14,11 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestMappingWrapperCube(unittest.TestCase): diff --git a/contrib/python-bindings/tests/point_wrapper.py b/contrib/python-bindings/tests/point_wrapper.py index 4c5a9390d8..794b7c68b2 100644 --- a/contrib/python-bindings/tests/point_wrapper.py +++ b/contrib/python-bindings/tests/point_wrapper.py @@ -15,7 +15,11 @@ import unittest import math -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestPointWrapper(unittest.TestCase): diff --git a/contrib/python-bindings/tests/quadrature_wrapper.py b/contrib/python-bindings/tests/quadrature_wrapper.py index 258f6b00d5..b93bc7055f 100644 --- a/contrib/python-bindings/tests/quadrature_wrapper.py +++ b/contrib/python-bindings/tests/quadrature_wrapper.py @@ -14,28 +14,32 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestQuadratureWrapper(unittest.TestCase): def test_gauss(self): quadrature = Quadrature(dim = 3) quadrature.create_gauss(n = 1); - + w_sum = 0. for weight in quadrature.weights(): w_sum += weight - + self.assertTrue(abs(1. - w_sum) < 1e-10) def test_gauss_lobatto(self): quadrature = Quadrature(dim = 3) quadrature.create_gauss_lobatto(n = 2); - + w_sum = 0. for weight in quadrature.weights(): w_sum += weight - + self.assertTrue(abs(1. - w_sum) < 1e-10) if __name__ == '__main__': diff --git a/contrib/python-bindings/tests/triangulation_wrapper.py b/contrib/python-bindings/tests/triangulation_wrapper.py index fea7fc5b57..800be864e1 100644 --- a/contrib/python-bindings/tests/triangulation_wrapper.py +++ b/contrib/python-bindings/tests/triangulation_wrapper.py @@ -14,7 +14,11 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestTriangulationWrapper(unittest.TestCase):