python-nose is broken with python 2.6.3-dev

Bug #389942 reported by Darren Dale on 2009-06-20
40
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Python
Fix Committed
Unknown
nose
Unknown
Unknown
nose (Ubuntu)
High
Unassigned
python2.6 (Ubuntu)
High
Unassigned

Bug Description

Binary package hint: python-nose

python-nose is broken in Karmic alpha 2:

$ nosetests
Traceback (most recent call last):
  File "/usr/bin/nosetests", line 8, in <module>
    load_entry_point('nose==0.10.4', 'console_scripts', 'nosetests')()
  File "/usr/lib/pymodules/python2.6/nose/core.py", line 219, in __init__
    argv=argv, testRunner=testRunner, testLoader=testLoader)
  File "/usr/lib/python2.6/unittest.py", line 819, in __init__
    self.runTests()
  File "/usr/lib/pymodules/python2.6/nose/core.py", line 298, in runTests
    result = self.testRunner.run(self.test)
TypeError: unbound method run() must be called with TextTestRunner instance as first argument (got ContextSuite instance instead)

Related branches

After a manual update to nose version 0.11.0 it is still fully broken the exact same way.
There is something broken here but I'm not sure what the root cause is...

It works fine with python2.5 but not with Python 2.6.2+ (release26-maint, Jun 19 2009, 15:16:33)

Darren Dale (dsdale24) wrote :

Perhaps something to do with where the package is installed? Maybe pkg_resources doesn't know how to handle all the unconventional package locations created by debian's python policy.

Stefan van der Walt (stefanv) wrote :

This looks similar to https://bugs.launchpad.net/ubuntu/+source/nose/+bug/337585

I can confirm that the problem still exists.

Andrew Straw (astraw) wrote :

It seems a difference between -0ubuntu1 and -0ubuntu2 (jaunty and karmic alpha 2) is this. It looks very relevant.

--- a/Lib/unittest.py
+++ b/Lib/unittest.py
@@ -798,8 +798,10 @@ Examples:
                                                in MyTestCase
 """
     def __init__(self, module='__main__', defaultTest=None,
- argv=None, testRunner=TextTestRunner,
+ argv=None, testRunner=None,
                  testLoader=defaultTestLoader):
+ if testRunner is None:
+ testRunner = TextTestRunner
         if type(module) == type(''):
             self.module = __import__(module)
             for part in module.split('.')[1:]:

Andrew Straw wrote:
> It seems a difference between -0ubuntu1 and -0ubuntu2 (jaunty and karmic
> alpha 2) is this. It looks very relevant.
>
> --- a/Lib/unittest.py
> +++ b/Lib/unittest.py
> @@ -798,8 +798,10 @@ Examples:
> in MyTestCase
> """
> def __init__(self, module='__main__', defaultTest=None,
> - argv=None, testRunner=TextTestRunner,
> + argv=None, testRunner=None,
> testLoader=defaultTestLoader):
> + if testRunner is None:
> + testRunner = TextTestRunner
> if type(module) == type(''):
> self.module = __import__(module)
> for part in module.split('.')[1:]:
>
>
https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/395362

NB that the change mentioned above is an upstream one.

The problem is in essence that an upstream change to unittest reveals a bug in how nose overrides TestProgram.runTests.

I shall file a bug upstream.

summary: - python-nose is broken in Karmic alpha 2
+ python-nose is broken with python 2.6.3-dev
spiderbit (stefan-canta-game) wrote :

http://bugs.python.org/issue6177

<- as i see it this bug is fixed since over a month in upstream, would make me happy if the maintainer could make a new python-release package that fix fix this problem.

Changed in nose (Ubuntu):
assignee: nobody → Python (python)
spiderbit (stefan-canta-game) wrote :

sorry, assigned to wrong person, ubuntu-core-dev is "the" maintainer

Changed in nose (Ubuntu):
assignee: Python (python) → Ubuntu Core Development Team (ubuntu-core-dev)
James Westby (james-w) on 2009-07-07
Changed in nose (Ubuntu):
assignee: Ubuntu Core Development Team (ubuntu-core-dev) → nobody
importance: Undecided → High
status: New → Triaged
Changed in python2.6 (Ubuntu):
importance: Undecided → High
status: New → Triaged
Changed in python:
status: Unknown → Fix Committed

no problem, if i can help you... i work all day with python

2009/7/7 spiderbit <email address hidden>:
> sorry, assigned to wrong person, ubuntu-core-dev is "the" maintainer
>
> ** Changed in: nose (Ubuntu)
>     Assignee: Python (python) => Ubuntu Core Development Team (ubuntu-core-dev)
>
> --
> python-nose is broken with python 2.6.3-dev
> https://bugs.launchpad.net/bugs/389942
> You received this bug notification because you are a member of Python,
> which is a bug assignee.
>

Where is the fix??
http://bugs.python.org/issue6177 does not provide the fix. It is the commit which *breaks* python-nose.

> Where is the fix??
> http://bugs.python.org/issue6177 does not provide the fix. It is the commit which *breaks* python-nose.
>
>
nosetests returns

Traceback (most recent call last):
  File "/usr/bin/nosetests", line 8, in <module>
    load_entry_point('nose==0.11.1', 'console_scripts', 'nosetests')()
  File "/usr/lib/pymodules/python2.6/nose/core.py", line 113, in __init__
    argv=argv, testRunner=testRunner, testLoader=testLoader)
  File "/usr/lib/python2.6/unittest.py", line 819, in __init__
    self.runTests()
  File "/usr/lib/pymodules/python2.6/nose/core.py", line 192, in runTests
    result = self.testRunner.run(self.test)
TypeError: unbound method run() must be called with TextTestRunner
instance as first argument (got ContextSuite instance instead)

It is still broken.

Xavier

spiderbit (stefan-canta-game) wrote :

Hmm ok I think you are right.

I did not test it. But i think you are right. Sorry i read next time more accuratly. I thought i see a bug that describes the bug, and a patch. But it seems to be another problem which fix broke this.

Indeed :)
Nose is still fully broken in karmic :(

File "/usr/lib/pymodules/python2.6/nose/core.py", line 192, in runTests
    result = self.testRunner.run(self.test)
TypeError: unbound method run() must be called with TextTestRunner instance as first argument (got ContextSuite instance instead)

JP (jpellerin+nose) wrote :

This is the upstream bug (in python core, not nose): http://bugs.python.org/issue6418

According to Michael Foord, it's fixed in the 2.6 branch and trunk. Maybe karmic isn't updated yet? I have no idea how or when that process happens.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.6 - 2.6.2-0ubuntu3

---------------
python2.6 (2.6.2-0ubuntu3) karmic; urgency=low

  * Add debian/patches/issue6418.dpatch taken from the 2.6 release branch
    to fix problems with other test runners. (LP: #389942)

 -- James Westby <email address hidden> Fri, 24 Jul 2009 11:24:35 +0200

Changed in python2.6 (Ubuntu):
status: Triaged → Fix Released
James Westby (james-w) on 2009-07-24
Changed in nose (Ubuntu):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.