﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24548	A testrunner test fails with unittest2 installed	David D. Riddle	nobody	"'''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]. "	Bug	closed	Testing framework	1.6	Normal	wontfix			Unreviewed	0	0	0	0	0	0
