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

Unit tests (even server unit tests) should not make network calls #985

Open
krivard opened this issue Sep 28, 2022 · 0 comments
Open

Unit tests (even server unit tests) should not make network calls #985

krivard opened this issue Sep 28, 2022 · 0 comments
Labels
help wanted tests integration & unit testing, bug triage and prevention

Comments

@krivard
Copy link
Contributor

krivard commented Sep 28, 2022

The following three tests failed when one of our volunteers was trying to run unit tests without having set up the integration test prerequisites. This shouldn't have been a problem, since the point of unit tests is to check the smallest units of functionality, mocking out more complex functions (like network connections).

It's not immediately obvious why these tests were making network calls -- I suspect that something in _common attempts to connect to the database on import.

We should do one of the following:

  • (ideal) figure out how to properly mock out network calls for flask tests
  • (or if that is not possible) move these tests to the integrations section
@melange396 melange396 added the tests integration & unit testing, bug triage and prevention label Oct 6, 2022
@BrainIsDead BrainIsDead self-assigned this Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted tests integration & unit testing, bug triage and prevention
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants