[Neuroimaging] advice on choosing a testing library
Jasper van den Bosch
japsai at gmail.com
Fri Jun 17 14:55:00 EDT 2016
I have never felt like I missed out when using unittest. The reason I've
known people to choose nose or py.test is that you need less boilerplate
code.
But when you need to test hierarchies of classes, being used to the
object-oriented style of unittest pays off.
Jasper
On 17 June 2016 at 09:55, Nate Vack <njvack at wisc.edu> wrote:
> I actually like pytest largely because it's so similar to unittest;
> however, on test errors it does a bunch of nice magic introspection to show
> me what's amiss. unittest is also good.
>
> I've also made use of the pytest's test parametrize decorator to test
> reading a whole heaping ton of file versions with one method, though
> there's an element of "this is dark magic and I kind of feel like maybe I
> should write tests to test my tests." In the end, it saved me a ton of code
> so I held my nose and did it; here's the example:
>
> https://github.com/njvack/bioread/blob/master/test/test_reader.py#L80
>
> -n
>
> On Fri, Jun 17, 2016 at 11:23 AM Satrajit Ghosh <satra at mit.edu> wrote:
>
>> thank you folks.
>>
>> is there a particular reason why the standard python unittest library is
>> not being used? it seems from the documentation that the two are quite
>> similar.
>>
>> https://docs.python.org/dev/library/unittest.html#basic-example
>>
>> if everyone is using py.test now, we can start moving towards it.
>>
>> cheers,
>>
>> satra
>>
>> On Fri, Jun 17, 2016 at 10:27 AM, Nate Vack <njvack at wisc.edu> wrote:
>>
>>> +1 to pytest.
>>>
>>> -n
>>>
>>> On Fri, Jun 17, 2016 at 9:25 AM Nathaniel Smith <njs at pobox.com> wrote:
>>>
>>>> AFAICT, literally everyone uses pytest, so that's what I've been moving
>>>> to. It's fine.
>>>> On Jun 17, 2016 06:35, "Satrajit Ghosh" <satra at mit.edu> wrote:
>>>>
>>>> hi folks,
>>>>
>>>> in nipype and other nipy projects we have used nose forever, but as
>>>> matthew noted, nose will likely not be maintained in the future. python now
>>>> has a unittest framework built into the standard library, and a large
>>>> number of other testing frameworks.
>>>>
>>>> https://wiki.python.org/moin/PythonTestingToolsTaxonomy
>>>>
>>>> are there suggestions on how one might make the decision on which
>>>> framework to choose?
>>>>
>>>> cheers,
>>>>
>>>> satra
>>>>
>>>>
>>>> _______________________________________________
>>>> Neuroimaging mailing list
>>>> Neuroimaging at python.org
>>>> https://mail.python.org/mailman/listinfo/neuroimaging
>>>>
>>>> _______________________________________________
>>>> Neuroimaging mailing list
>>>> Neuroimaging at python.org
>>>> https://mail.python.org/mailman/listinfo/neuroimaging
>>>>
>>>
>>> _______________________________________________
>>> Neuroimaging mailing list
>>> Neuroimaging at python.org
>>> https://mail.python.org/mailman/listinfo/neuroimaging
>>>
>>>
>> _______________________________________________
>> Neuroimaging mailing list
>> Neuroimaging at python.org
>> https://mail.python.org/mailman/listinfo/neuroimaging
>>
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20160617/f27a2a1b/attachment.html>
More information about the Neuroimaging
mailing list