Hi

Mocker and mock are totally different. Mock is in stdlib since 3.3 so it is likely the future but I found mocker easier to use and understand (I'm also the current maintainer for mocker, if inactive a bit).

As for nose/py.test: both are a bit non standard. I would strongly recommend that you use unittest2, the python 2.x backport of updated stdlib test stuff. It has a lot of compatible extensions. Python.test and nose have those too but 1) they are not compatible 2) IMHO there is no advantage over stock stuff _anymore_

Lastly Django is a bit of a different story but it gets healthier lately. Strongly recommend to track what key upstream devs are doing there and why. It will likely be in next django release and if you choose badly you'll drift apart from other projects.

Quick question: do you have a list of requirements?

Thanks
ZK

El 16/07/2013 11:54, "Milo Casagrande" <milo.casagrande@linaro.org> va escriure:
Hello everyone,

one of the discussion we had during connect was to find (and use) a
common testing framework for unit (and maybe beyond) tests.
What we should use is probably a framework that still supports all the
unittest based tests we already have in our projects.

Following also other people suggestions, I looked around and did some
initial tests. What follows is a list of what we could use:

- pytest: http://pytest.org/latest/
- nose: https://nose.readthedocs.org/en/latest/
- stick with Python provided unittest: no need to install anything else

Personally I do not dislike unittest even if of the three is the most
verbose, but pytest is a powerful handy tool and easier to use (you
don't even need to inherit from TestCase).

I didn't play with pytest and Django tests, but looks like it is
possible to easily integrate it:

http://pytest-django.readthedocs.org/en/latest/

Tools:

These kind of tools are more targeted at mocking/patching objects or
behavior, should we avoid them or use them? (no flame wars please! :-)
Personally I find that sometimes (probably too often) I need them. If
we need them we should suggest which one to use, and stick with it:

- mock: http://www.voidspace.org.uk/python/mock/
- mocker: https://pypi.python.org/pypi/mocker

There are more, but these two are the ones I know about or have been using.
Other suggestions?

Ciao!

--
Milo Casagrande | Automation Engineer
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

_______________________________________________
linaro-validation mailing list
linaro-validation@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-validation