HomeDevCentral

Don't run the application in test environment

Description

Don't run the application in test environment

Summary:
Currently, the application was always initialized, and
only for the web server, a check the app wasn't imported
was done.

In an unit testing context, we don't always want to initialize
the application, for example it's not useful to test helper methods.

Yet, each time the app was imported, the check_config method was called,
and so software exited with error code 1 if environment wasn't correctly
configured, a requirement for the microservice, but not for the test suite.

Test Plan:

  • Run the app, ensure server is spawned
  • Import the app in another Python source code, ensure nothing is executed

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D1006

Details

Provenance
derecksonAuthored on Mar 23 2018, 21:59
derecksonPushed on Mar 23 2018, 22:00
Reviewer
dereckson
Differential Revision
D1006: Don't run the application in test environment
Parents
rND8e639d1b053c: Improve PEP-8 whitespaces alignment
Branches
Unknown
Tags
Unknown