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

Possible regression: Table 'sessions' is already defined #245

Open
Blockguy24 opened this issue May 12, 2024 · 0 comments
Open

Possible regression: Table 'sessions' is already defined #245

Blockguy24 opened this issue May 12, 2024 · 0 comments

Comments

@Blockguy24
Copy link

I was writing some unit tests for my application, which uses the application factory pattern. A new app instance is created for each unittest.TestCase class using setUpClass. The tests work fine, until a new TestCase is encountered and the app gets set up again. This time, an exception occurs when initialising:

sqlalchemy.exc.InvalidRequestError: Table 'sessions' is already defined for this MetaData instance.

This seems to be related to issues #75, #131 and #175, but even though fixes have been applied to resolve those, I'm experiencing issues now on version 0.8.0.

A workaround I found for this is to call db.metadata.clear() in my tearDownClass but I feel like this shouldn't be necessary.

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

No branches or pull requests

1 participant