Skip to content
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

ResourceWarning emitted by petscpy causes PytestUnraisableExceptionWarning when using -Werror flag #1549

Open
lbianchi-lbl opened this issue Dec 12, 2024 · 0 comments
Labels
Priority:Low Low Priority Issue or PR wontfix This will not be worked on

Comments

@lbianchi-lbl
Copy link
Contributor

lbianchi-lbl commented Dec 12, 2024

image

  • This seems to happen when running a test with a dynamic model when running pytest with the -Werror flag that turns errors into exceptions
  • This is not necessarily an error (and even if it was I'm not sure how much we could do to address the root cause) but I wanted to document this after encountering it while enabling "warnings as errors" in Ensure no unhandled warnings are emitted during pytest run watertap-org/watertap#1540
  • The remedy is to add a filterwarnings line, e.g. ignore:unclosed file .*Visualization-data/SA-.*\.bin:ResourceWarning
lbianchi-lbl added a commit to watertap-org/watertap that referenced this issue Dec 13, 2024
* 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
@lbianchi-lbl lbianchi-lbl added wontfix This will not be worked on Priority:Low Low Priority Issue or PR labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Low Low Priority Issue or PR wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant