Hello,
On Tue, 16 Jul 2013 12:52:59 +0200 Zygmunt Bazyli Krynicki zkrynicki@gmail.com wrote:
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.
Please define "standard". Let's read http://docs.python.org/2/library/unittest.html : "The Python unit testing framework, sometimes referred to as “PyUnit,” is a Python language version of JUnit". So, what we read is that Python somehow includes Java's standard test facility, but what's standard for Java is not natural for Python (or we could just stick with Java in the first place). "Standard" is what follows language philosophy, and nosetests is truly adheres to that - easy and intuitive start, learn extra and more powerful features as you progress and need them.
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.
Looking at https://pypi.python.org/pypi/unittest2 : "The new features in unittest for Python 2.7 backported to Python 2.3+." So, it appears it's confusion: there's no unittest2 really (well, maybe there's in Python2.4 world, but where's that?), it's just unittest of Python2.7.
Python.test and nose have those too but 1) they are not compatible 2) IMHO there is no advantage over stock stuff _anymore_
Looking at http://www.voidspace.org.uk/python/articles/unittest2.shtml , it starts with advertizing alphabet soup like:
assertIDontKnownHowItsWrittenLessOrEqualOrEqualOrLess()
So, how there's "no advantage over stock stuff _anymore_", can I just create a dir "tests", put "test_it.py" file there, write in it:
=== def test(): assert foo <= 5 ===
Run single command w/o params and get tests run?