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

Filter unclosed database warning from sqlite3 #2519

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Sep 4, 2024

The Python 3.13 sqlite3 module added a new warning which is being issued during testing.
I do not know if there is an actual fix.

@cjmayo cjmayo mentioned this pull request Oct 16, 2024
@samuelhwilliams
Copy link
Contributor

Have you looked into anything that would fix them properly before we just ignore them?

I feel like we or our tests must be doing something wrong here.

@samuelhwilliams
Copy link
Contributor

samuelhwilliams commented Oct 27, 2024

I've seemingly fixed all but one of these errors with this changeset: samuelhwilliams/flask-admin@ce6cca5, see test run

The one outstanding failure seems to jump between different unit tests every now and again, which suggests something a little flaky/unstable. Haven't yet narrowed down what this is. I suspect our tests are not well isolated and/or our conftest setup is doing something wrong.

@cjmayo
Copy link
Contributor Author

cjmayo commented Oct 27, 2024

I've seemingly fixed all but one of these errors with this changeset: samuelhwilliams/flask-admin@ce6cca5, see test run

That's great. I could see something needed to go after the yield but didn't know what.

The one outstanding failure seems to jump between different unit tests every now and again, which suggests something a little flaky/unstable. Haven't yet narrowed down what this is. I suspect our tests are not well isolated and/or our conftest setup is doing something wrong.

Looks like it is something that can't just be ignored:

pytest.PytestUnraisableExceptionWarning: Exception ignored in: <sqlite3.Connection object at 0x7f33924c0220>

Traceback (most recent call last):
  File "/home/runner/work/flask-admin/flask-admin/.tox/py3.13/lib/python3.13/site-packages/sqlalchemy/event/base.py", line 148, in __init__
    self._empty_listeners = self._empty_listener_reg[instance_cls]
                            ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/weakref.py", line 415, in __getitem__
    return self.data[ref(key)]
           ~~~~~~~~~^^^^^^^^^^
KeyError: <weakref at 0x7f33931bcc20; to 'type' at 0x56002fd34b70 (Session)>

https://github.com/pallets-eco/flask-admin/actions/runs/11543216111/job/32127332191?pr=2542#step:9:6504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants