[IPython-dev] Interactive input block handling

Brian Granger ellisonbg@gmail....
Wed Jul 21 12:00:57 CDT 2010


Fernando,

Fantastic!  Great work.  Ping me when you wake up and we can
strategize the next steps and do a code review of this.

Cheers,

Brian

On Wed, Jul 21, 2010 at 3:32 AM, Fernando Perez <fperez.net@gmail.com> wrote:
> Hi folks,
>
> here:
>
> http://github.com/fperez/ipython/commit/37182fcaaa893488c4655cd37049bb71b1f9152a
>
> is the code that Evan can start using now (and so can Omar as we
> refactor the terminal code) for properly handling incremental
> interactive input.  I ran out of time to add the block-splitting
> capabilities for Gerardo, but that should be easy tomorrow.
>
> It would be a good habit to get into for all new code, to attempt as
> best as possible 100% test coverage:
>
> (blockbreaker)amirbar[core]> nosetests -vvs --with-coverage
> --cover-package=IPython.core.blockbreaker blockbreaker.py
> test_dedent (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_indent (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_indent2 (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_interactive_block_ready
> (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_interactive_block_ready2
> (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_interactive_block_ready3
> (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_interactive_block_ready4
> (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_push (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_push2 (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> Test input with leading whitespace ... ok
> test_reset (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> test_source (IPython.core.blockbreaker.BlockBreakerTestCase) ... ok
> IPython.core.blockbreaker.test_spaces ... ok
> IPython.core.blockbreaker.test_remove_comments ... ok
> IPython.core.blockbreaker.test_get_input_encoding ... ok
>
> Name                        Stmts   Exec  Cover   Missing
> ---------------------------------------------------------
> IPython.core.blockbreaker     171    171   100%
> ----------------------------------------------------------------------
> Ran 15 tests in 0.022s
>
> OK
>
>
> ###
>
> In this case it actually helped me a lot, because in going from ~85%
> to 100% I actually found that the untested codepaths were indeed
> buggy.  As the saying goes, 'untested code is broken code'...
>
> Cheers,
>
> f
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu
ellisonbg@gmail.com


More information about the IPython-dev mailing list