-
Notifications
You must be signed in to change notification settings - Fork 32
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
Reduce number of warnings emitted during testing #2887
Conversation
…es a warning Fixes 2 instances of: UserWarning: No inputs provided in call to ... Signed-off-by: Jan Vesely <[email protected]>
Simplify parametrization ids. Fixes: SyntaxWarning: "is" with a literal. Did you mean "=="? Signed-off-by: Jan Vesely <[email protected]>
Return both result and num_executions_before_finished. Fixes: PytestBenchmarkWarning: Benchmark fixture was not used at all in this test! Signed-off-by: Jan Vesely <[email protected]>
Makes the test benchmark agnostic. Remove explicit benchmark re-run from the test. Fixes: PytestBenchmarkWarning: Benchmark fixture was not used at all in this test! Signed-off-by: Jan Vesely <[email protected]>
Having multiple parameter ports for parameters of the same name is now an error. There is no difference in emitted warnings with or without this filter. Signed-off-by: Jan Vesely <[email protected]>
Tests should not return anything. Fixes: PytestReturnNotNoneWarning: Expected None, but tests/composition/test_composition.py::TestNestedCompositions::test_invalid_projection_deletion_when_nesting_comps returned (Composition ocomp), which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`? Signed-off-by: Jan Vesely <[email protected]>
The construct has been deprecated in pytest warns about it: PytestRemovedIn8Warning: Passing None has been deprecated. See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases. Address three different situations in tests in a way that does not hide unrelated warnings. * test_composition.py::*_subset_duplicate_warnings: capture all warnings and search them for the expected message if verbosity == True assert that there are no warnings if verbosity == False * test_projection_specifications.py::test_no_warning_when_matrix_specified: Use filterwarnings mark to change the undesired warning into an error * test_control.py::test_model_based_num_estimates Use null context or pytest.warns context based on whether warning is expected Signed-off-by: Jan Vesely <[email protected]>
Square brackets '[' denote a match set and need to be escaped. Fixes: FutureWarning: Possible nested set at position ... Signed-off-by: Jan Vesely <[email protected]>
Convert tested value to np.array and check its size. Fixes: DeprecationWarning: The truth value of an empty array is ambiguous. ... DeprecationWarning: elementwise comparison failed; ... Signed-off-by: Jan Vesely <[email protected]>
The expression replaces calculated np.log values with 0 if both v1 and v2 values at a given index are 0. Skip the computation of np.log(v2) in this case to avoid invalid values. Fixes: RuntimeWarning: divide by zero encountered in log RuntimeWarning: invalid value encountered in multiply Signed-off-by: Jan Vesely <[email protected]>
Otherwise they might end up compared as containers. Fixes: FutureWarning: elementwise comparison failed; ... Signed-off-by: Jan Vesely <[email protected]>
Fixes 3 instances of: FutureWarning: Setting parameter values directly using dot notation may be removed in a future release. Signed-off-by: Jan Vesely <[email protected]>
…rix() instead of mod_matrix The latter is deprecated. Signed-off-by: Jan Vesely <[email protected]>
Signed-off-by: Jan Vesely <[email protected]>
This PR causes the following changes to the html docs (ubuntu-latest-3.11-x64):
See CI logs for the full diff. |
Remaining warnings:
|
This PR causes the following changes to the html docs (ubuntu-latest-3.11-x64):
See CI logs for the full diff. |
A collection of minor fixes and updates improves the handling of warnings by updating tests to use new interfaces.
The original distribution of warnings when running 4 test jobs was 7299 emitted warnings in 211 locations:
5 DeprecationWarning
9 FutureWarning
1 MatplotlibDeprecationWarning
4 PendingDeprecationWarning
12 PNLCompilerWarning
2 PytestBenchmarkWarning
1 PytestRemovedIn8Warning
1 PytestReturnNotNoneWarning
4 RuntimeWarning
1 SyntaxWarning
171 UserWarning
Changes in this PR reduce this to 5696 emitted warnings in 191 locations:
2 FutureWarning
1 MatplotlibDeprecationWarning
4 PendingDeprecationWarning
12 PNLCompilerWarning
2 RuntimeWarning
170 UserWarning
Individual commits target different warning classes.