vishnevskiy/greentornado — pull request #2 by Kroisse (2013-03-05 06:42:13+00:00)
Title: Wraps greened function to imitate the original function.

There was a problem that the function decorated by `@greenify` doesn't look like the original one. for example:

```py
@greentornado.greenify
def job():
"""Do something"""
pass

assert job.__doc__ == 'Do something' # fail
```

It can be messed in some cases like inspecting that function, or doing [doctest][], or documenting using [Sphinx][], or else. So I decorated the wrapper function with [`@functools.wraps`][1]

To convince myself (and the other contributors in the future) that this change works properly, I added some simple tests about that changes. [py.test][] and [tox][] are also introduced for the convenient testing.

[doctest]: http://docs.python.org/2/library/doctest.html
[Sphinx]: http://sphinx-doc.org/
[1]: http://docs.python.org/2/library/functools.html#functools.wraps
[py.test]: http://pytest.org/latest/
[tox]: http://tox.readthedocs.org/en/latest/