You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Treat SA cartesian products as warnings under test (#16529)
This is a commonly-hit SQLAlchemy footgun, but one easily remedied
by treating the warning SQLALchemy raises as an error under pytest.
I verified this by running against commit 8a5ad08, which produced
these failures:
FAILED tests/unit/forklift/test_legacy.py::TestFileUpload::test_new_release_url_verified[https://github.com/foo/bar/readme.md-True] - sqlalchemy.exc.SAWarning: SELECT statement has a cartesian product between FROM element(s) "release_urls" and FROM element "releases". A...
FAILED tests/unit/forklift/test_legacy.py::TestFileUpload::test_new_release_url_verified[https://google.com-False] - sqlalchemy.exc.SAWarning: SELECT statement has a cartesian product between FROM element(s) "releases" and FROM element "release_urls". A...
FAILED tests/unit/forklift/test_legacy.py::TestFileUpload::test_new_release_url_verified[https://github.com/foo/bar-True] - sqlalchemy.exc.SAWarning: SELECT statement has a cartesian product between FROM element(s) "release_urls" and FROM element "releases". A...
FAILED tests/unit/forklift/test_legacy.py::TestFileUpload::test_new_release_url_verified[https://github.com/foo-False] - sqlalchemy.exc.SAWarning: SELECT statement has a cartesian product between FROM element(s) "releases" and FROM element "release_urls". A...
FAILED tests/unit/forklift/test_legacy.py::TestFileUpload::test_new_publisher_verifies_existing_release_url - sqlalchemy.exc.SAWarning: SELECT statement has a cartesian product between FROM element(s) "releases" and FROM element "release_urls". A...
FAILED tests/unit/forklift/test_legacy.py::TestFileUpload::test_new_release_url_verified[https://github.com/foo/bar/-True] - sqlalchemy.exc.SAWarning: SELECT statement has a cartesian product between FROM element(s) "releases" and FROM element "release_urls". A...
Results (84.29s (0:01:24)):
4209 passed
6 failed
- tests/unit/forklift/test_legacy.py:3842 TestFileUpload.test_new_release_url_verified[https://github.com/foo/bar/readme.md-True]
- tests/unit/forklift/test_legacy.py:3842 TestFileUpload.test_new_release_url_verified[https://google.com-False]
- tests/unit/forklift/test_legacy.py:3842 TestFileUpload.test_new_release_url_verified[https://github.com/foo/bar-True]
- tests/unit/forklift/test_legacy.py:3842 TestFileUpload.test_new_release_url_verified[https://github.com/foo-False]
- tests/unit/forklift/test_legacy.py:3911 TestFileUpload.test_new_publisher_verifies_existing_release_url
- tests/unit/forklift/test_legacy.py:3842 TestFileUpload.test_new_release_url_verified[https://github.com/foo/bar/-True]
On 9de75b8 the build is clean.
0 commit comments