python-chuck-norris: powerful assertions
outubro 28, 2010 2 Comentários
If your python project is in trouble, the deadline is close and you are unable to make your tests pass, wait no longer, Chuck Norris will help you out.
Just install python-chuck-norris package on pypi:
sudo pip install python-chuck-norris
Or directly from the Github project:
git clone git://github.com/ricobl/python-chuck-norris.git
cd python-chuck-norris
sudo python setup.py install
Then just use Chuck’s powerful assertions to make your tests pass, like this:
import chuck
def test_chuck_power():
chuck.assert_true(False) # passes
chuck.assert_true(True) # passes
chuck.assert_true(None) # passes
chuck.fail() # raises RoundHouseKick exception
It’s better then commenting asserts! Great!
It’s better than writing tests!