-
Notifications
You must be signed in to change notification settings - Fork 357
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
Properly import missing functions in PyNEST hl_api
#2213
Conversation
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.
LGTM!
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.
Could you add some regression tests that cover the logic that use these functions? I implemented #2135 shotgun style with the unit tests, and these weren't covered 😛
It seems that #2135 produces more bugs than I registered. However I added two functions |
if help_text: | ||
self.assertTrue(isinstance(help_text, str)) | ||
else: | ||
self.assetsIfNone(help_text) |
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.
What's this function? It looks autocorrect-suspiciously much like assertIsNone
;p
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.
Unit tests are usually deterministic and based on a-priori knowledge, how come you need to check what help_text
is? Shouldn't we find a case that is always str, and one that is always None
so that we can confirm both cases?
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.
A general comment: Since we now use PyTest, please use plain assert
s instead of self.assertXYZ
.
What kind of bugs are they? The |
The function In the testsuite html/rst files are not built (no |
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 tend to agree with @babsey that testing the help system in this way is not so easy, as it requires a full make doc
to actually be of use. My suggestion is to remove the tests again, merge this PR and open an issue that could then be solved with a broader scope.
@@ -25,6 +25,11 @@ | |||
|
|||
class TestHelperFunctions(unittest.TestCase): | |||
|
|||
def test_load_help(self): | |||
help_text = nest.hl_api.load_help('ac_generator') |
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.
hl_api
is gone and the load_help
function is merely meant as a helper, so I'm not sure we actually should test it in this way.
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.
Of course, I meant to request changes instead of approving ;-)
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.
Thanks for spotting these :)
hl_api
hl_api
hl_api
This PR fixes the bug that
load_help
is missing inpynest/nest/lib/hl_api_info.py
.Updated: Also
sli_func
is missing inpynest/nest/lib/hl_api_helper.py
.These bugs exist since this PR: #2135