This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Tim.Graham
Recipients Tim.Graham, ezio.melotti, jonash, michael.foord, pitrou, rbcollins, vstinner
Date 2017-11-27.15:55:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This is appearing as a backwards incompatible change for Django because test case class attributes are now evaluated at load time before setUpClass runs (which initializes some things that those class attributes use). It's possible to adapt Django for this change, but it might affect other projects as well.

Traceback from Django's tests:

$ python -Wall tests/ 
Testing against Django installed in '/home/tim/code/django/django' with up to 3 processes
Traceback (most recent call last):
  File "tests/", line 477, in <module>
  File "tests/", line 282, in django_tests
  File "/home/tim/code/django/django/test/", line 598, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File "/home/tim/code/django/django/test/", line 513, in build_suite
    tests =, **kwargs)
  File "/home/tim/code/cpython/Lib/unittest/", line 346, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/home/tim/code/cpython/Lib/unittest/", line 403, in _find_tests
    full_path, pattern, namespace)
  File "/home/tim/code/cpython/Lib/unittest/", line 457, in _find_test_path
    return self.loadTestsFromModule(module, pattern=pattern), False
  File "/home/tim/code/cpython/Lib/unittest/", line 124, in loadTestsFromModule
  File "/home/tim/code/cpython/Lib/unittest/", line 90, in loadTestsFromTestCase
    testCaseNames = self.getTestCaseNames(testCaseClass)
  File "/home/tim/code/cpython/Lib/unittest/", line 234, in getTestCaseNames
    testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass)))
  File "/home/tim/code/cpython/Lib/unittest/", line 227, in shouldIncludeMethod
    testFunc = getattr(testCaseClass, attrname)
  File "/home/tim/code/django/django/utils/", line 172, in __get__
    return self.fget(cls)
  File "/home/tim/code/django/django/test/", line 1269, in live_server_url
    return 'http://%s:%s' % (, cls.server_thread.port)
AttributeError: type object 'AdminSeleniumTestCase' has no attribute 'server_thread'
Date User Action Args
2017-11-27 15:55:05Tim.Grahamsetrecipients: + Tim.Graham, pitrou, vstinner, rbcollins, ezio.melotti, michael.foord, jonash
2017-11-27 15:55:05Tim.Grahamsetmessageid: <>
2017-11-27 15:55:05Tim.Grahamlinkissue32071 messages
2017-11-27 15:55:05Tim.Grahamcreate