cmu-delphi/delphi-epidata

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

オープン

#985 opened on 2022/09/28

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Python (67 件のフォーク)auto 404
help wantedtests

Repository metrics

Stars
 (104 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド