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

fix(test): clean_db fixtures does not break if table is missing #8054

Merged
merged 1 commit into from Feb 6, 2024

Conversation

smotornyuk
Copy link
Member

When you import a custom model, it's registered inside SQLAlchemy's metadata. After this, clean_db fixture executes DELETE FROM ... for this table.

If a custom model gets imported but its table does not exist(for example, you imported a helper function from the module, that contains a custom model), clean_db raises ProgrammingError and breaks the test.

After this change, non-existing tables will be ignored.

@wardi wardi merged commit da65f53 into master Feb 6, 2024
7 of 8 checks passed
@wardi wardi deleted the missing-tables-in-clean_db branch February 6, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants