-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure no unhandled warnings are emitted during pytest run (#1540)
* Resolve warning for markers applied to fixtures * Resolve warning for test function with return value * Mark test as component rather than unit since it uses a solver * Add handling for expected warnings emitted by parameter_sweep * Remove redundant marker registration * Do not ignore warnings * Treat warnings as exceptions when running pytest in CI * Use raw string literal to escape regex char * Move warnings-as-errors config to pytest.ini and handle IDAES/idaes-pse#1549 * Use raw string literal to resolve SyntaxErrors * Try resolving failures in notebook tests * Try using a more specific filter * Add filter for yet again another ResourceWarning * Reduce test output * Add --cov flag previously defined unconditionally in pytest.ini * Make filterwarnings regex Windows-compatible * Add marker for expected warning observed on macOS CI run * Resolve Pyomo deprecation warnings spotted in docs build log
- Loading branch information
1 parent
f3cb0bb
commit 80d9ac7
Showing
13 changed files
with
46 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[pytest] | ||
addopts = --durations=100 | ||
--cov=watertap | ||
addopts = --durations=10 | ||
--cov-config=.coveragerc | ||
testpaths = watertap | ||
log_file = pytest.log | ||
log_file_date_format = %Y-%m-%dT%H:%M:%S | ||
log_file_format = %(asctime)s %(levelname)-7s <%(filename)s:%(lineno)d> %(message)s | ||
log_file_level = INFO | ||
filterwarnings = | ||
ignore::DeprecationWarning | ||
markers = | ||
unit: mark test as unit tests. | ||
component: mark test as longer, bigger, more complex than unit tests. | ||
ui: mark test as relevant to the ui | ||
error | ||
# see IDAES/idaes-pse#1549 | ||
ignore:unclosed file .*Visualization-data.*SA-.*\.bin:ResourceWarning | ||
# emitted sporadically during nbmake tests | ||
ignore:unclosed <socket\.socket .*>:ResourceWarning | ||
ignore:unclosed event loop .*:ResourceWarning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters