Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit fc041a3c1c13bfa9a240cb2785acd25517379c0e 1 parent 0b7f5de
@malcolmt malcolmt authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 tests/runtests.py
View
6 tests/runtests.py
@@ -60,8 +60,14 @@ def runTest(self):
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')
Please sign in to comment.
Something went wrong with that request. Please try again.