[IPython-dev] Unit testing
Brian Granger
ellisonbg.net at gmail.com
Wed Sep 17 14:21:29 EDT 2008
Ville,
Fernando knows much better about how nose finds tests, but I think in
this case I know what the issue is. Nose only looks for tests in
modules names *test*.py. We are putting such files in locations like
IPython.tests
IPython.kernel.tests
IPython.frontend.tests
etc.
Broadly speaking, any package should have a tests sub-directory that
has test modules for each module in the package:
foo.py
bar.py
tests
test_foo.py
test_bar.py
If you then go put your unittests or nose tests in test_foo.py or
test_bar.py nose should pick them up automatically.
The tests for the ipy_profile_sh.py module would probably go into
IPython.tests.test_profile_sh.py
Does that help? Fernando, any other wisdom as to how nose finds tests?
We need to update our Sphinx developer docs about this.
Cheers,
Brian
On Wed, Sep 17, 2008 at 10:01 AM, Ville M. Vainio <vivainio at gmail.com> wrote:
> Since it appears we will be using nose to run the unit test, and since
> IPython "classic" has zero tests that are run by the current test
> suite (from what I gathered from running ./iptest), where can I get
> started on writing such tests?
>
> I tried adding this to ipy_profile_sh.py:
>
> def test():
> assert False
>
> And, it wasn't run by nose. So, where should we get started? Create
> 'test' directories?
>
> --
> Ville M. Vainio
> http://tinyurl.com/vainio
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev
>
More information about the IPython-dev
mailing list