[Numpy-discussion] tests in distutils/exec_command.py

Pearu Peterson pearu at cens.ioc.ee
Sat Apr 26 13:03:22 EDT 2008


On Sat, April 26, 2008 7:53 pm, Zbyszek Szmek wrote:
> Hi,
> while looking at test coverage statistics published Stéfan van der Walt
> at http://mentat.za.net/numpy/coverage/, I noticed that the
> least-covered file, numpy/distutils/exec_command.py has it's own
> test routines, e.g.:
> def test_svn(**kws):
>     s,o = exec_command(['svn','status'],**kws)
>     assert s,(s,o)
>     print 'svn ok'
>
> called as
> if __name__ == "__main__":
>    test_svn(use_tee=1)
>
> The sense of this test seems reversed (svn status runs just fine):
> Traceback (most recent call last):
>   File "numpy/distutils/exec_command.py", line 591, in <module>
>     test_svn(use_tee=1)
>   File "numpy/distutils/exec_command.py", line 567, in test_svn
>     assert s,(s,o)
> AssertionError: (0, '')
>
> Should the test be cleaned up and moved into a seperate file in
> numpy/distutils/tests/ ?

Note that not all tests in exec_command.py are platform independent
(as it is the case with most distutils tools in general). So, be careful
when copying the tests to numpy/distutils/tests.

Pearu




More information about the NumPy-Discussion mailing list