fabric/fabric — pull request #766 by todddeluca (2012-10-28 04:26:10+00:00)
Title: Use task variable name when task name is undefined.

In fabric.main.extract_tasks(), the dict mapping names to new-style task
objects now uses the variable name of the object when the object's name
attribute is not defined. (Technically, when not obj.name or obj.name
== 'undefined').

This change brings the behavior for mapping tasks to names in compliance
with the fabric documentation.
http://docs.fabfile.org/en/1.4.3/usage/tasks.html#new-style-tasks:

Subclass Task (Task itself is intended to be abstract), define a run
method, and instantiate your subclass at module level. Instances’
name attributes are used as the task name; if omitted the instance’s
variable name will be used instead.

A test case was added to confirm that the task name equal the variable
name when the task object name attribute is undefined. This test fails
with the old code and passes with the patched code.