summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-08-17 12:29:08 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-08-17 12:29:08 +0000
commitfc041a3c1c13bfa9a240cb2785acd25517379c0e (patch)
tree5e3a197fda7821399196dd3bc9c57ee42895425b
parent0b7f5def7fed7c3579604dfe34027c2927d6eace (diff)
Made output for invalid model tests more consistent (removed colored output).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5914 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rwxr-xr-xtests/runtests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index 61788ea349..85aea50180 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -60,8 +60,14 @@ class InvalidModelTestCase(unittest.TestCase):
except Exception, e:
self.fail('Unable to load invalid model module')
+ # Make sure sys.stdout is not a tty so that we get errors without
+ # coloring attached (makes matching the results easier). We restore
+ # sys.stderr afterwards.
+ orig_stdout = sys.stdout
s = StringIO()
+ sys.stdout = s
count = get_validation_errors(s, module)
+ sys.stdout = orig_stdout
s.seek(0)
error_log = s.read()
actual = error_log.split('\n')