Name: unclebob
Owner: Yipit
Description: django tool for running tests organized between unit, functional and integration
Created: 2015-08-31 21:20:08.0
Updated: 2015-08-31 21:20:09.0
Pushed: 2016-08-08 19:03:51.0
Size: 128
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Version 0.4.0
UncleBob is a simple django app that allow you writting per-app tests within these paths:
<appname>/tests/unit/test*.py
- for unit tests<appname>/tests/functional/test*.py
- for functional tests<appname>/tests/integration/test*.py
- for integration testspip install unclebob
on settings.py
ALLED_APPS = (
...
'unclebob',
...
_RUNNER = 'unclebob.runners.Nose'
rt unclebob
ebob.take_care_of_my_tests()
just use the regular test command:
python manage.py test
python manage.py test --unit
python manage.py test --functional
python manage.py test --integration
python manage.py test path/to/app/tests
or
python manage.py test path/to/app/tests/unit
if you run only the unit
tests, then unclebob is NOT going to setup
the test database. Since
unit tests are supposed
to be “unwired”, what I mean is that unit tests MUST NOT make use of
actual database, filesystem or network at all.
Instead, they must test isolated parts of your code.
For that reason, ma'am/sir, Uncle Bob is gonna break your neck in case you decide to use those, so called, “external resources” in your unit tests.
in your settings.py
EBOB_NO_DATABASE = True
When unclebob is running tests, it sets the environment variable
UNCLEBOB_RUNNING
to the current working directory.
You can use it, for example, in your codebase fr avoiding logging during the tests.
nose is such a really nice tool for writting tests on python.
Instead of using the unittest framework, which is builtin python thou is less fun to use.
And you know, the most joyable is the writting/running test experience, more developers will write tests for the project. And as much tests, better.
This project was named after Uncle Bob Martin, one of the agile manifesto chaps that brought code cleaness techniques and advices to the rest of us.