From 353c5f339188acc847f035f78b7a66531459e49b Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sun, 9 Feb 2020 23:10:58 -0500 Subject: [PATCH] [Test] Make deprecation warnings fatal for all ways of running tests Since tests like test_composite.TestModels.test_load_thermo_models rely on deprecation warnings being fatal, we need to make sure that this setting is always enabled. Previously, running the tests using "python -m unittest" instead of the runCythonTests.py script did not do this. Fixes #802 --- interfaces/cython/cantera/test/utilities.py | 1 + test/python/runCythonTests.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/interfaces/cython/cantera/test/utilities.py b/interfaces/cython/cantera/test/utilities.py index 79ac68461e..5f2f20edf2 100644 --- a/interfaces/cython/cantera/test/utilities.py +++ b/interfaces/cython/cantera/test/utilities.py @@ -32,6 +32,7 @@ def setUpClass(cls): else: cls.test_work_dir = tempfile.mkdtemp() + cantera.make_deprecation_warnings_fatal() cantera.add_directory(cls.test_work_dir) cls.test_data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'data')) cls.cantera_data = os.path.abspath(os.path.join( diff --git a/test/python/runCythonTests.py b/test/python/runCythonTests.py index bbccde20e1..54534f2806 100644 --- a/test/python/runCythonTests.py +++ b/test/python/runCythonTests.py @@ -36,8 +36,6 @@ import cantera import cantera.test -cantera.make_deprecation_warnings_fatal() - class TestResult(unittest.TextTestResult): def __init__(self, *args, **kwargs): unittest.TextTestResult.__init__(self, *args, **kwargs)