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

Feature/test performance - pytest speed up #864

Merged
merged 6 commits into from
Nov 8, 2024

Conversation

scottmcdonnell
Copy link
Contributor

Problem
pytest all tests running very slow as all database tables are created and dropped for each test

Solution
move the table creation and drop to once per class setUpClass and tearDownClass.
Set up a Sqlalchemy session in each task setUp that is rolled back in tearDown.

Result: big speed increase in running tests.

@frankrousseau
Copy link
Contributor

Hello @scottmcdonnell,

Thank you for this very helpful contribution. Could you make all tests green? If not we'll have a look at it. It seems most of them are ok.

@scottmcdonnell
Copy link
Contributor Author

I took this speed up from another project of ours and adjusted it from pytest fixtures to your unit test classes. Unfortunately, I don't have the bandwidth at the moment to debug the few tests that are failing. If you don't get to it I can look at it later this month.

@EvanBldy EvanBldy force-pushed the feature/test-performance branch 2 times, most recently from afb1f67 to c010592 Compare October 8, 2024 16:35
@EvanBldy EvanBldy merged commit 9fb22c3 into cgwire:master Nov 8, 2024
3 of 7 checks passed
@EvanBldy EvanBldy mentioned this pull request Nov 13, 2024
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

Successfully merging this pull request may close these issues.

3 participants