Skip to content
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

DM-30148: PipelineTasks use wrong label as name #123

Merged
merged 3 commits into from May 12, 2021
Merged

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented May 11, 2021

This PR fixes a name collision inadvertently introduced in #122, and adds unit tests to catch similar bugs in the future.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A PR that is almost all tests to find and fix a small bit of code and add coverage to un-covered code. Wholehearted approval!

A few docs-related suggestions, but otherwise good.

return mock


class TaskFactoryTestCase(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring: it's not obvious to me what a "TaskFactory" test would be testing. I think it's testing TaskFactory.makeTask() with a variety of combinations of optional arguments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It tests the functionality of TaskFactory (which happens to consist of one method)? I'm not sure what I could say that wouldn't be obvious.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, maybe the fact that TaskFactory itself is short on documentation is really my problem? I was looking at the test without knowing anything about TaskFactory: I didn't know it only had one method.

tests/test_taskFactory.py Outdated Show resolved Hide resolved
overrides=None, butler=None)
self.tracker.assert_called_with(config=FakeConfig(), initInputs=None, name=None)

def testAllOptions(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a test of makeTask called with all kwargs? Maybe rename it or add a docstring.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testOnlyMandatoryArg and testAllArgs?

Note that "kwargs" is kind of a pointless term here, since none of the parameters have defaults.

tests/test_taskFactory.py Outdated Show resolved Hide resolved
Policy is to only update for the current year, but I've added missing
entries for 2019-2020 as well.
@kfindeisen kfindeisen merged commit 78d2a6e into master May 12, 2021
@kfindeisen kfindeisen deleted the tickets/DM-30148 branch May 12, 2021 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants