On Mon, Apr 14, 2014 at 5:26 AM,  <m...@pagan.io> wrote:
> Greetings,
>
> I'm working on an additional function for numpy/lib/twodim_base.py. I'm
> trying to add some tests for the new function, and
> numpy/lib/tests/test_twodim_base.py seems like the right place for
> them.
> My problem is travis-ci tells me my tests are no good.
>
> The error message I get on my local machine is:
>
> ValueError: no such test method in <class '__main__.TestElementary'>:
> runTest

Please copy-and-paste the whole error message. Can you point to your
code somewhere and the travis-ci results? How are you running the test
suite? `numpy.test()` is the right way to do so. Do not use
`unittest.main()` or `python -m unittest ...` to run the numpy test
suite.

> (TestElementary is the class I made to put my tests in).
>
> This error makes me think I need a to put in a function like
>
> def __init__(self, methodName="runTest"):
>
> or maybe
>
> def runTest(self):
>
> somewhere. I don't see functions like this associated with any of the
> other classes in numpy/lib/tests/test_twodim_base.py though.

You would never do so, no. numpy uses the `nose` test runner which
does not need these. If you were using the standard unittest test
collector, you would subclass `TestElementary` from
`unittest.TestCase`, and that would provide the correct `__init__()`
and `runTest()` methods.

-- 
Robert Kern
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to