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 Aug 5, 2015
1 parent 754bbda commit 72a35e4
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 72a35e4

Please sign in to comment.