[IPython-dev] fixing warnings in python2.6

Ondrej Certik ondrej@certik...
Mon Mar 16 22:33:28 CDT 2009


On Mon, Mar 16, 2009 at 8:27 PM, Fernando Perez <fperez.net@gmail.com> wrote:
> 2009/3/16 Ondrej Certik <ondrej@certik.cz>:
>
>> I created the patch with:
>>
>> $ bzr send -o python2.6.patch
>> Using saved parent location
>> "http://bazaar.launchpad.net/%7Eipython-dev/ipython/trunk/" to
>> determine what changes to submit.
>> Bundling 1 revision(s)
>>
>>
>> is that the correct way?
>
> That works, you can also email a plain old diff-based patch from 'bzr
> diff', or make your own branch on launchpad, if you expect it to be an
> ongoing development with feedback.
>
>> How can I execute tests? I tried to find such an info at:
>>
>> http://ipython.scipy.org/moin/Developer_Zone
>
> Sorry, we should have a link to the dev part of the manual up there.
> These days we're trying to keep as much as we can in the sphinx doc
> tree (the one you started! :)

But that was a year ago. :)

> http://ipython.scipy.org/doc/manual/html/development/development.html#testing-system
>
> Right now on my branch (note that for me, iptest is an alias to 'iptest -vvs'):
>
> maqroll[tmp]> iptest
> *** Pasting of code with ">>>" or "..." has been enabled.
> c referrers: [<type 'dict'>]
> x is: 1
> Doctest: IPython.Extensions.InterpreterPasteInput ... ok
> Doctest: IPython.Extensions.astyle.Style.__init__ ... ok
>
> [ lots of output]
>
> ----------------------------------------------------------------------
> Ran 528 tests in 42.611s
>
> OK (SKIP=11)

I am getting:

$ python2.5 scripts/iptest
S...S.....................................................................................................................................................................................................................................................................................................................................................................................................................S..S..SS..SSS........
----------------------------------------------------------------------
Ran 431 tests in 23.585s

OK (SKIP=9)


Which is ok, but this is a disaster:

$ scripts/iptest
Traceback (most recent call last):
  File "scripts/iptest", line 8, in <module>
    iptest.main()
  File "/home/ondrej/repos/ipython/IPython/testing/iptest.py", line 53, in main
    TestProgram(argv=argv,plugins=plugins)
  File "/var/lib/python-support/python2.6/nose/core.py", line 219, in __init__
    argv=argv, testRunner=testRunner, testLoader=testLoader)
  File "/usr/lib/python2.6/unittest.py", line 816, in __init__
    self.parseArgs(argv)
  File "/var/lib/python-support/python2.6/nose/core.py", line 270, in parseArgs
    self.createTests()
  File "/var/lib/python-support/python2.6/nose/core.py", line 284, in
createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 422,
in loadTestsFromNames
    return unittest.TestLoader.loadTestsFromNames(self, names, module)
  File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/var/lib/python-support/python2.6/nose/loader.py", line 377,
in loadTestsFromName
    module, discovered=discovered)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 301,
in loadTestsFromModule
    tests.extend(self.loadTestsFromDir(path))
  File "/var/lib/python-support/python2.6/nose/loader.py", line 165,
in loadTestsFromDir
    entry_path, discovered=True)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 377,
in loadTestsFromName
    module, discovered=discovered)
  File "/var/lib/python-support/python2.6/nose/loader.py", line 306,
in loadTestsFromModule
    return self.suiteClass(ContextList(tests, context=module))
  File "/var/lib/python-support/python2.6/nose/suite.py", line 332, in __call__
    return self.makeSuite(tests, context)
  File "/var/lib/python-support/python2.6/nose/suite.py", line 377, in makeSuite
    self.context.setdefault(suite, []).append(context)
TypeError: unhashable type: 'ContextSuite'


So I guess I should first install nosetests that work with python2.6.


Ondrej


More information about the IPython-dev mailing list