Browse Source

Refs #28814 -- Fixed test_runner failure on Python 3.7.

Due to https://bugs.python.org/issue30399.
Tim Graham 7 years ago
parent
commit
9d1d3b2d2f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      tests/test_runner/test_parallel.py

+ 4 - 2
tests/test_runner/test_parallel.py

@@ -2,6 +2,7 @@ import unittest
 
 from django.test import SimpleTestCase
 from django.test.runner import RemoteTestResult
+from django.utils.version import PY37
 
 try:
     import tblib
@@ -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 PY37 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)