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

pytest_sessionfinish cannot access database for cleanup #1123

Open
syndionaldo opened this issue May 21, 2024 · 0 comments
Open

pytest_sessionfinish cannot access database for cleanup #1123

syndionaldo opened this issue May 21, 2024 · 0 comments

Comments

@syndionaldo
Copy link

For a given scenario, I need to undo some migrations in order to let the test database be gracefully deleted. One of those migrations creates a replication subscription that avoids the database to be removed. The solution would be to use pytest_sessionfinish hook to undo some migrations and let the teardown process to run gracefully.

However, pytest_django is avoiding the hook to complete, denying database access to it. I cannot find a way around this in order to implement this. The result: the test database need to be removed manually, which breaks the entire deployment automation.

Is there any way of doing it?

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

No branches or pull requests

1 participant