summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-11-17 16:12:48 -0500
committerTim Graham <timograham@gmail.com>2017-11-17 17:25:20 -0500
commit5b21e3983dfce04251dbb795a70859c1ee78db8e (patch)
tree5cb1b3d186fe1bf7e0b05859ed534629d17dc513
parent8e63cc582f8ab66e5d8a94a72b6d12eb4c7e85e6 (diff)
[2.0.x] Refs #28814 -- Fixed test_runner failure on Python 3.7.
Due to https://bugs.python.org/issue30399. Backport of 9d1d3b2d2fe0bef995b024368088eeabbdf73629 from master
-rw-r--r--tests/test_runner/test_parallel.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_runner/test_parallel.py b/tests/test_runner/test_parallel.py
index 0b575a606a..5892532e24 100644
--- a/tests/test_runner/test_parallel.py
+++ b/tests/test_runner/test_parallel.py
@@ -1,3 +1,4 @@
+import sys
import unittest
from django.test import SimpleTestCase
@@ -79,7 +80,8 @@ class RemoteTestResultTest(SimpleTestCase):
event = events[1]
self.assertEqual(event[0], 'addSubTest')
self.assertEqual(str(event[2]), 'dummy_test (test_runner.test_parallel.SampleFailingSubtest) (index=0)')
- self.assertEqual(repr(event[3][1]), "AssertionError('0 != 1',)")
+ trailing_comma = '' if sys.version_info >= (3, 7) else ','
+ self.assertEqual(repr(event[3][1]), "AssertionError('0 != 1'%s)" % trailing_comma)
event = events[2]
- self.assertEqual(repr(event[3][1]), "AssertionError('2 != 1',)")
+ self.assertEqual(repr(event[3][1]), "AssertionError('2 != 1'%s)" % trailing_comma)