Skip to content

Commit

Permalink
[Test] Make deprecation warnings fatal for all ways of running tests
Browse files Browse the repository at this point in the history
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 Cantera#802
  • Loading branch information
speth authored and srikanthallu committed Sep 17, 2020
1 parent 27fbca3 commit 353c5f3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions interfaces/cython/cantera/test/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions test/python/runCythonTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 353c5f3

Please sign in to comment.