Skip to content

Commit 0386b97

Browse files
committed
Fixed test_runner test failure on Python 3.5; refs #23763.
Python change is http://bugs.python.org/issue22032
1 parent 1e219ac commit 0386b97

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_runner/test_debug_sql.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import unittest
23

34
from django.db import connection
@@ -82,9 +83,12 @@ def test_output_verbose(self):
8283
]
8384

8485
verbose_expected_outputs = [
85-
'runTest (test_runner.test_debug_sql.FailingTest) ... FAIL',
86-
'runTest (test_runner.test_debug_sql.ErrorTest) ... ERROR',
87-
'runTest (test_runner.test_debug_sql.PassingTest) ... ok',
86+
# Output format changed in Python 3.5+
87+
x.format('' if sys.version_info < (3, 5) else 'TestDebugSQL.') for x in [
88+
'runTest (test_runner.test_debug_sql.{}FailingTest) ... FAIL',
89+
'runTest (test_runner.test_debug_sql.{}ErrorTest) ... ERROR',
90+
'runTest (test_runner.test_debug_sql.{}PassingTest) ... ok',
91+
]
8892
]
8993
if six.PY3:
9094
verbose_expected_outputs += [

0 commit comments

Comments
 (0)