[IPython-dev] fixing warnings in python2.6

Fernando Perez fperez.net at gmail.com
Tue Mar 17 00:16:45 EDT 2009


On Mon, Mar 16, 2009 at 9:00 PM, Ondrej Certik <ondrej at certik.cz> wrote:
>> That's about right, I've written tons of tests and made the testing
>> machinery more robust, so it picks up more doctests as well.  But that
>> number sounds right for the current trunk.
> With sympy we thought it'd be nice to have some kind of hash or
> something, so that one is sure that it is picking up all the tests
> that it should.

Yes, that would be very good to have indeed.

> We were burned by a bug in py.test that it didn't find some tests and
> noone discovered it for couple months, so you can imagine how I
> pleased I was to fix the code that got broken because it was not
> tested just because the tests were not executed. :)

> I wrote my own test runner for sympy exactly because I wanted
> something simple, that works everywhere, I am now implementing
> parallel runs. Does nosetest support it?
> According to this:
> http://code.google.com/p/python-nose/issues/detail?id=93
> it doesn't. My runner is compatible with py.test and nosetests, if you
> only use standard function tests. It can also pickup doctests and it
> works with python2.6. It's available at in
> sympy/utilities/runtests.py:
> http://git.sympy.org/?p=sympy.git;a=blob;f=sympy/utilities/runtests.py;h=e0034d945455305463a4572e90a8d04cd688d386;hb=HEAD
> and it has the nice green [OK] that I always wanted, if you remember.
> :) I hope to polish it, so that it can be used in any project, by just
> executing it in the project dir.

Nice!  I'd be happy to play with it, if it can:

- handle doctests in extension modules

- handle doctests written with ipython prompts (or be taught how to
via a plugin, like I had to do for nose)

- easily be told how to run just one file, or even just one function
inside one file:

maqroll[~]> iptest IPython.tests.test_magic
Ran 10 tests in 0.348s

Deleting object: second_pass
maqroll[~]> iptest IPython.tests.test_magic:test_obj_del
Ran 1 test in 0.204s


- How to ignore random output in doctests, either in just one entry or
for the whole doctest, but still executing the code

- Stop at the first failure

- Load pdb interactively on failures, so I can debug things right there.

Does it have those things?  Nose ain't perfect, but it's pretty darn
useful even without green 'ok' printouts ;)



More information about the IPython-dev mailing list