Skip to content

Commit

Permalink
Restore sys.stdout for db delete prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
millerdev committed Oct 7, 2015
1 parent a4034f8 commit b8568ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion django_nose/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,13 @@ def __init__(self, tests, runner):

def setup(self):
"""Setup database."""
self.old_names = self.runner.setup_databases()
# temporarily restore sys.stdout in case of propmt to delete database
test_stdout = sys.stdout
sys.stdout = sys.__stdout__
try:
self.old_names = self.runner.setup_databases()
finally:
sys.stdout = test_stdout

def teardown(self):
"""Tear down database."""
Expand Down

0 comments on commit b8568ed

Please sign in to comment.