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-7232: Py.test updates #20

Merged
merged 12 commits into from Aug 17, 2016
Merged

DM-7232: Py.test updates #20

merged 12 commits into from Aug 17, 2016

Conversation

timj
Copy link
Member

@timj timj commented Aug 15, 2016

No description provided.

class AddTask(pipeBase.Task):
ConfigClass = AddConfig

@pipeBase.timeMethod
def run(self, val):
self.metadata.add("add", self.config.addend)
return pipeBase.Struct(
val = val + self.config.addend,
val=val + self.config.addend,
Copy link
Member Author

Choose a reason for hiding this comment

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

The spaces are required.

Copy link
Contributor

Choose a reason for hiding this comment

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

corrected

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm sorry. I was wrong. I had not realised these were actually keyword arguments to a function. In which case the space around the equals is not allowed :-(

Copy link
Contributor

Choose a reason for hiding this comment

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

They are corrected back to without the spaces.

if __name__ == '__main__':
run(True)
if __name__ == "__main__":
utilsTests.init()
Copy link
Member Author

Choose a reason for hiding this comment

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

we are trying to migrate away from using utilsTests short cut. It is preferred to use lsst.utils.tests explicitly.

Copy link
Member

Choose a reason for hiding this comment

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

Woohoo! (camelCase namespace aliases are a pet peeve of mine).

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed in a later commit

@hsinfang hsinfang force-pushed the tickets/DM-7232 branch 6 times, most recently from 1b18b74 to 2392857 Compare August 17, 2016 14:36
This commit updates tests/testTask.py to use the py.test framework.
Replaced assertTrue, assert_, & assertEquals.
This commit updates tests/testStruct.py to use the py.test framework.
Autopep8'd the test file.
This commit updates tests/testArgumentParser.py to use the py.test framework.
Hsin-Fang Chiang and others added 6 commits August 17, 2016 09:47
To avoid pytest warnings, rename TestTask to ExampleTask,
TestMultipleIdTaskRunner to ExampleMultipleIdTaskRunner,
and TestMultipleIdTask to ExampleMultipleIdTask.
The usage of aliases such as utilsTests is not encouraged anymore. This
commit removes suych usage from testTask.py, testStruct.py and
testArgumentParser.py
The namespace depends on the test runner environment.
@hsinfang hsinfang merged commit 9cd2862 into master Aug 17, 2016
@ktlim ktlim deleted the tickets/DM-7232 branch August 25, 2018 06:50
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

5 participants