VirtualTam's bookmarks
44 bookmarks found
-
Obey the testing goat...
2015-05-10 - Test first! Test first!
-
TaskBuster Django tutorial
2015-05-10 -
PHP - Testing your privates
2015-03-17 How to test a private or protected method with PHPUnit?
see also: https://sebastian-bergmann.de/archives/881-Testing-Your-Privates.html
-
United Diversity - Library
2015-03-15 A collection of misc. resources: FLOSS, ecology, architecture...
-
Python unit testing frameworks: Nose, Pytest
2015-02-13 Python's built-in unittest module is quite cool, but a bit limited and way too verbose (read: it's quite not easy to incite developers to write unit tests)
I'm currently looking for more dev-friendly solutions, the key points being:
- writing test code should be easy and straight-forward -keep the focus on "what to test" instead of "how to transcribe a process to a test"
- parallelization! -we, spoiled developers, should make good use of our way-too-many-cores build machines...
- complete feature set!
- we don't want to just run tests...
- coverage reports (find dead/weak/untested code sections)
- output formatting (JUnit-XML seems to be quite a common format out there)
There seem to be 3 solutions in Python:
- stock unittest + project-dependent customizations / test helpers
- nosetests
- py.test
And 2 ways of gettings things done:
- keeping things stock: no external dependency, project-specific implementation...
- using a test framework: one more module in your (test) virtualenv, more concise tests, more features (// run, code coverage, etc.)
Some links:
-
Python: run specific unit tests
2015-02-13 Given your unittests are in the
tests
directory:1# run a specific test module 2python -m unittest tests.<module> 3 4# run a specific test suite 5python -m unittest tests.<module>.<class> 6 7# run a specific test 8python -m unittest tests.<module>.<class>.<test> 9 10# run tests matching a given pattern 11python -m unittest discover -s tests -p <pattern>
-
nose: python testing helper
2015-01-04 Includes support for Coverage, Xunit and other cool stuff ;-) Oh, and there is parallel testing, too \o/
nosetests --with-coverage --cover-erase --cover-tests --cover-html --cover-html-dir=htmlcov --with-xunit --xunit-file=unit.xml
via http://www.alexconrad.org/2011/10/jenkins-and-python.html
-
Continuous integration in Python
2014-11-27 http://ilovesymposia.com/2014/10/01/continuous-integration-0-automated-tests-with-pytest/ http://ilovesymposia.com/2014/10/02/continuous-integration-1-test-coverage/ http://ilovesymposia.com/2014/10/13/continuous-integration-in-python-3-set-up-your-test-configuration-files/ http://ilovesymposia.com/2014/10/15/continuous-integration-in-python-4-set-up-travis-ci/ http://ilovesymposia.com/2014/10/15/continuous-integration-in-python-5-report-test-coverage-using-coveralls/ http://ilovesymposia.com/2014/10/17/continuous-integration-in-python-6-show-off-your-work/ http://ilovesymposia.com/2014/10/27/continuous-integration-in-python-7-some-helper-tools-and-final-thoughts/
-
Awesome thread! The topvoted comments show extremely good - yet simple - reasons to become a unit test maniac ;-)
See also:
-
Test-Driven Development with Python
2014-11-21 -
Python bad practice, a concrete case
2014-11-14 -
Python - Code coverage
2014-09-01