Rasjid Wilcox <ras...@familywilcox.net> writes:

> To date I've mostly used Nose for my unit testing, but was just
> wanting to canvas views on what the current state of the art in Python
> testing is, and if I should be looking at something else.

I use Python 2.7, or Python 3, and use the standard library ‘unittest’
along with ‘testtools’ <URL:http://testtools.readthedocs.org/>
and ‘testscenarios’ <URL:https://pypi.python.org/pypi/testscenarios>.

The ‘unittest’ library in Python's standard library has been
significantly improved. Developers using Python 3 get the full benefits,
but Python 2.7 also had many of the improvements back-ported.

* Test case discovery
* Specify test cases from command line
* More assertion methods, more comparison methods
* ‘assertRaises’ as a context manager (for ‘with’)
* Adding cleanup functions
* Skipping tests conditionally
* Class-level and module-level fixtures
* etc.

Michael Foord was a primary developer and advocate of these
improvements. Here is his description from 2011
<URL:http://www.voidspace.org.uk/python/articles/unittest2.shtml>.

All those improvements, along with the wonderful author-defined Matchers
in ‘testtools’ and the data-driven testing from ‘testscenarios’, I
virtually have no need of anything more than those.

And they're easily accepted by my team, whereas switching to a different
test framework would be (correctly) met with much more resistance.

-- 
 \         “Sunday: A day given over by Americans to wishing that they |
  `\      themselves were dead and in Heaven, and that their neighbors |
_o__)                        were dead and in Hell.” —Henry L. Mencken |
Ben Finney

_______________________________________________
melbourne-pug mailing list
melbourne-pug@python.org
http://mail.python.org/mailman/listinfo/melbourne-pug

Reply via email to