#24548: A testrunner test fails with unittest2 installed
-----------------------------------+--------------------
     Reporter:  ddriddle           |      Owner:  nobody
         Type:  Bug                |     Status:  new
    Component:  Testing framework  |    Version:  1.6
     Severity:  Normal             |   Keywords:
 Triage Stage:  Unreviewed         |  Has patch:  0
Easy pickings:  0                  |      UI/UX:  0
-----------------------------------+--------------------
 '''RHEL6 system with Python 2.7.5'''
 {{{
 ddriddle@sdg-py27-dev:~/tmp/Django-1.6.11/tests$ python ./runtests.py
 --settings=test_sqlite -v0
 ======================================================================
 ERROR: test_dotted_test_method_vanilla_unittest
 (test_runner.test_discover_runner.DiscoverRunnerTest)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 
"/services/scratch/ddriddle/tmp/Django-1.6.11/tests/test_runner/test_discover_runner.py",
 line 57, in test_dotted_test_method_vanilla_unittest
 ["test_discovery_sample.tests_sample.TestVanillaUnittest.test_sample"],
   File "/opt/cites-sdg/sdg_2015a_python27/root/usr/lib/python2.7/site-
 packages/django/test/runner.py", line 63, in build_suite
     tests = self.test_loader.loadTestsFromName(label)
   File "/opt/rh/python27/root/usr/lib/python2.7/site-
 packages/unittest2/loader.py", line 219, in loadTestsFromName
     test = obj()
 TypeError: unbound method test_sample() must be called with
 TestVanillaUnittest instance as first argument (got nothing instead)
 }}}

 '''Debian 7.8 with Python 2.7.3'''
 {{{
 ddriddle@rockband:~/src/Django-1.6.11/tests$ python ./runtests.py
 --settings=test_sqlite -v0 test_runner
 ----------------------------------------------------------------------
 Ran 31 tests in 0.770s

 OK
 ddriddle@rockband:~/src/Django-1.6.11/tests$ easy_install -U --user
 unittest2
 ddriddle@rockband:~/src/Django-1.6.11/tests$ python ./runtests.py
 --settings=test_sqlite -v0 test_runner
 ======================================================================
 ERROR: test_dotted_test_method_vanilla_unittest
 (test_runner.test_discover_runner.DiscoverRunnerTest)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 "/home/ddriddle/src/Django-1.6.11/tests/test_runner/test_discover_runner.py",
 line 57, in test_dotted_test_method_vanilla_unittest
 ["test_discovery_sample.tests_sample.TestVanillaUnittest.test_sample"],
   File "/home/ddriddle/.local/lib/python2.7/site-
 packages/django/test/runner.py", line 63, in build_suite
     tests = self.test_loader.loadTestsFromName(label)
   File "/home/ddriddle/.local/lib/python2.7/site-
 packages/unittest2-1.0.1-py2.7.egg/unittest2/loader.py", line 219, in
 loadTestsFromName
     test = obj()
 TypeError: unbound method test_sample() must be called with
 TestVanillaUnittest instance as first argument (got nothing instead)

 ----------------------------------------------------------------------
 Ran 31 tests in 0.827s

 FAILED (errors=1)
 }}}

 This bug only happens when unitest2 is installed. I tested this on RHEL6
 with Python 2.7.5 and Debian 7.8 with Python 2.7.3. The Django version
 used in both cases was Django 1.6.11. This bug is related to ticket
 [ticket:20437].

--
Ticket URL: <https://code.djangoproject.com/ticket/24548>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.20040bc197e04e4be9a91810b1c65de6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to