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 <1511798105.42.0.213398074469.issue32071@psf.upfronthosting.co.za>
In-reply-to
Content
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/runtests.py 
Testing against Django installed in '/home/tim/code/django/django' with up to 3 processes
Traceback (most recent call last):
  File "tests/runtests.py", line 477, in <module>
    options.exclude_tags,
  File "tests/runtests.py", line 282, in django_tests
    extra_tests=extra_tests,
  File "/home/tim/code/django/django/test/runner.py", line 598, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File "/home/tim/code/django/django/test/runner.py", line 513, in build_suite
    tests = self.test_loader.discover(start_dir=label, **kwargs)
  File "/home/tim/code/cpython/Lib/unittest/loader.py", line 346, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/home/tim/code/cpython/Lib/unittest/loader.py", line 403, in _find_tests
    full_path, pattern, namespace)
  File "/home/tim/code/cpython/Lib/unittest/loader.py", line 457, in _find_test_path
    return self.loadTestsFromModule(module, pattern=pattern), False
  File "/home/tim/code/cpython/Lib/unittest/loader.py", line 124, in loadTestsFromModule
    tests.append(self.loadTestsFromTestCase(obj))
  File "/home/tim/code/cpython/Lib/unittest/loader.py", line 90, in loadTestsFromTestCase
    testCaseNames = self.getTestCaseNames(testCaseClass)
  File "/home/tim/code/cpython/Lib/unittest/loader.py", line 234, in getTestCaseNames
    testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass)))
  File "/home/tim/code/cpython/Lib/unittest/loader.py", line 227, in shouldIncludeMethod
    testFunc = getattr(testCaseClass, attrname)
  File "/home/tim/code/django/django/utils/decorators.py", line 172, in __get__
    return self.fget(cls)
  File "/home/tim/code/django/django/test/testcases.py", line 1269, in live_server_url
    return 'http://%s:%s' % (cls.host, cls.server_thread.port)
AttributeError: type object 'AdminSeleniumTestCase' has no attribute 'server_thread'
History
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: <1511798105.42.0.213398074469.issue32071@psf.upfronthosting.co.za>
2017-11-27 15:55:05Tim.Grahamlinkissue32071 messages
2017-11-27 15:55:05Tim.Grahamcreate