Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Silence warnings displayed by python unit tests
There were two categories of warnings being displayed, those related to the xdist plugin, and those related to SQLAlchemy 2.0 migration. The xdist plugin warnings are due to a bug in pytest-cov, see: pytest-dev/pytest-cov#557 We just ignore them entirely for now, as that issue seems to be quiet. The SQLAlchemy 2.0 migration warnings have 2 sub-categories. The first being that `declarative_base` has moved modules, and that warning is removed by using the proper import. However, once that `declarative_base` warning is removed, one encounters: .../pbench/server/database/models/datasets.py:875: RemovedIn20Warning: "Metadata" object is being merged into a Session along the backref cascade path for relationship "Dataset.metadatas"; in SQLAlchemy 2.0, this reverse cascade will not take place. Set cascade_backrefs to False in either the relationship() or backref() function for the 2.0 behavior; or to set globally for the whole Session, set the future=True flag (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) meta = Metadata(**kwargs) Since we are no going to migrate to SQLAlchemy 2.0 any time soon, it seemed appropriate to just use the big hammer and turn the warnings off entirely.
- Loading branch information