-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix bug when an AttributeError is raised, and add unit tests for xtrigger #3060
Conversation
Related back port of the fix is here: And for some reason the Travis unit test is failing... No obvious error I can see |
@dwsutherland added onre more commit. Codacy was complaining about the So added a This should speed up Codacy, and prevent it of reporting issues in |
Codacy is now happy! Just waiting for Travis now 🎉 |
yup |
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.
Looks good! thanks for the tutorial, I need to write more of these 😁
3fdff38
to
af6d060
Compare
Thanks @dwsutherland ! And a FYI, I push-forced to edit the last commit, as the |
af6d060
to
326ca51
Compare
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 👍
Still need this @kinow ? |
Yup @hjoliver , preparing one now. Was just waiting for David's other back port to go first. Will rebase my 7.8.x branch, cherry pick and prepare a backport for this one. Thanks!! |
@dwsutherland, @hjoliver here are the unit tests for
get_func
, and that part of theSuiteConfig
code that checks if the Xtrigger function is a callable.One of the final unit tests was to check what would happen if we got an
AttributeError
, instead of anImportError
/ModuleNotFoundError
. That is possible when you have a Xtrigger filecylc.py
but without thecylc()
function (I believe xtrigger module and function name are expected to match).@dwsutherland I reckon this
AttributeError
would also cause the suite to hang? That error was propagated, instead of aSuiteConfigError
, so I included a commit in this pull request to catch that error as well.Now wait for Travis. Took a bit longer because decided to write using pytest instead of unittest the new test for
cylc.config
and because also decided to cover theAttributeError
branch ofget_func
(secondif
statement in that function I think).If approved, will prepare a back port for 7.8.x.
Cheers
Bruno