New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection doesn't use the specified task name when importing from a module #96

Closed
thedrow opened this Issue Nov 14, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@thedrow
Contributor

thedrow commented Nov 14, 2013

Line 118 in collections.py should be:

for name, task in tasks:
            if task.name:
                name = task.name
            collection.add_task(name=name, task=task)

This works like it should.

I have no time to create a pull request with tests for now but I might later if you can't find the time as well.

@bitprophet

This comment has been minimized.

Member

bitprophet commented Nov 27, 2013

Hrm, add_task is supposed to do this already, e.g. here - but because we're always handing in the module's bound name (when this is run via from_module), that block won't execute (as it tests for name==None).

Will try to straighten this out w/ a test case - thanks!

bitprophet added a commit that referenced this issue Nov 27, 2013

@bitprophet

This comment has been minimized.

Member

bitprophet commented Nov 27, 2013

Heh forgot the flag the ticket number in the actual fix - it's cca348a - was able to just simplify from_module and now the "what is my name" block in add_task does all the work for us in both cases :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment