Skip to content

Commit

Permalink
Do Not Call SystemExit During Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derks committed Jun 2, 2015
1 parent efe0c77 commit 5e383ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cement-app/@module@/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ class Meta:
class @class_prefix@TestApp(@class_prefix@App):
"""A test app that is better suited for testing."""
class Meta:
# default argv to empty (don't use sys.argv)
argv = []

# don't look for config files (could break tests)
config_files = []

# don't call sys.exit() when app.close() is called in tests
exit_on_close = False


# Define the applicaiton object outside of main, as some libraries might wish
# to import it as a global (rather than passing it into another class/func)
Expand Down

0 comments on commit 5e383ae

Please sign in to comment.