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
Conversation
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spaces are required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
There was a problem hiding this comment.
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 :-(
There was a problem hiding this comment.
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.
a296ef9
to
73e134f
Compare
if __name__ == '__main__': | ||
run(True) | ||
if __name__ == "__main__": | ||
utilsTests.init() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
1b18b74
to
2392857
Compare
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.
Autopep8'd the test file.
2392857
to
f5aadfc
Compare
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.
f5aadfc
to
9cd2862
Compare
No description provided.