[Django] #24548: A testrunner test fails with unittest2 installed

14 views
Skip to first unread message

Django

unread,
Mar 27, 2015, 3:36:21 PM3/27/15
to django-...@googlegroups.com
#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.

Django

unread,
Mar 27, 2015, 4:10:23 PM3/27/15
to django-...@googlegroups.com
#24548: A testrunner test fails with unittest2 installed
-----------------------------------+--------------------------------------
Reporter: ddriddle | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: 1.6
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by timgraham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_docs: => 0


Comment:

Django 1.6 is only receiving security fixes at this point.

--
Ticket URL: <https://code.djangoproject.com/ticket/24548#comment:1>

Django

unread,
Mar 27, 2015, 4:15:03 PM3/27/15
to django-...@googlegroups.com
#24548: A testrunner test fails with unittest2 installed
-----------------------------------+--------------------------------------
Reporter: ddriddle | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: 1.6
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by ddriddle):

I did some further testing and this bug does not exist in master or 1.7.x.

--
Ticket URL: <https://code.djangoproject.com/ticket/24548#comment:2>

Django

unread,
Mar 31, 2015, 3:44:26 PM3/31/15
to django-...@googlegroups.com
#24548: A testrunner test fails with unittest2 installed
-----------------------------------+--------------------------------------
Reporter: ddriddle | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: 1.6
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by ddriddle):

I created a fix for this issue. I know it will not be merged in but I am
documenting this fix for others that might find it helpful. The patch can
be found here: https://github.com/ddriddle/django/tree/ticket_24548

--
Ticket URL: <https://code.djangoproject.com/ticket/24548#comment:3>

Reply all
Reply to author
Forward
0 new messages