-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some tests fail silently when testing overloaded methods #802
Comments
Also, a question about the test class... The implementation looks like class TestModels(utilities.CanteraTest):
@classmethod
def setUpClass(cls):
utilities.CanteraTest.setUpClass()
cls.yml_file = pjoin(cls.test_data_dir, "thermo-models.yaml")
with open(cls.yml_file, 'rt', encoding="utf-8") as stream:
cls.yml = yaml.safe_load(stream)
... Any reason to use |
I wonder if this might be fixed by #796? I'll check when I get a few minutes |
Not sure, but will look into it tomorrow (I currently don’t have a toolchain on my laptop). Regarding unit tests, I only checked/verified the scons varieties. |
@ischoegl great, thank you. FYI, conda packages for 2.5.0a4 are now up for Linux and macOS (Windows is failing for unknown reasons 😭), including Python 3.8. I just commented out the test at issue here to get it to build 😬 |
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
The changes already in #796 were related, but not quite what was needed to fix this. I've added an additional change that does -- the issue is that this test relies on deprecation warnings being fatal, which was being set only in The point of |
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
System information
Expected behavior
Tests pass
Actual behavior
Some tests fail
To Reproduce
scons build
PYTHONPATH=build/python python -m unittest -v cantera.test.test_composite.TestModels.test_load_thermo_models
Output:
Also
and no error is thrown.
This can also be seen in the builds for the conda packages: https://travis-ci.org/Cantera/conda-recipes/jobs/637035389#L5088
When all the tests are run (using either
scons test
orscons test-python
) this test passes. The difference is callingunittest
explicitly, which is done both in my reproduction and in the conda builds.I think the warning about the overloaded method means that the method that actually raises this error is not called, so we should not be testing for the error condition yet. @ischoegl this is related to your work in #720. Do you have any thoughts here?
The text was updated successfully, but these errors were encountered: