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

test: Speed up tests by more than 500% #209

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

abhiabhi94
Copy link
Collaborator

  • use django's SimpleTestCase wherever database access is not required.
  • use a separate module for testing that is lesser secure but faster.

@abhiabhi94
Copy link
Collaborator Author

For some unscientific comparisons, these are the results when run on my machine:

Before:

Ran 395 tests in 68.571s

After:

Ran 395 tests in 10.824s

@abhiabhi94
Copy link
Collaborator Author

I have created a separate settings module for tests because I thought you @Radi85, use the current one for live demo. In case you don't, I can make the changes directly to the original settings module.

@abhiabhi94 abhiabhi94 force-pushed the test/make-tests-faster branch 2 times, most recently from 27b9b9a to f3ca3f0 Compare May 29, 2021 14:25
- use django's `SimpleTestCase` wherever database access is not required.
- use a separate module for testing that is lesser secure but faster.
@Radi85
Copy link
Owner

Radi85 commented Jun 16, 2021

I have created a separate settings module for tests because I thought you @Radi85, use the current one for live demo. In case you don't, I can make the changes directly to the original settings module.

Yes I am using it in the live demo.

Copy link
Owner

@Radi85 Radi85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@Radi85 Radi85 merged commit 2d22131 into Radi85:develop Jun 16, 2021
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.

2 participants