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
Improve error message with wrong xspec version #422
Improve error message with wrong xspec version #422
Conversation
sherpa/astro/xspec/utils.py
Outdated
@@ -93,4 +95,5 @@ class version_at_least(include_if): | |||
the xspec version detected at runtime is equal or greater than the one provided to the decorator. | |||
""" | |||
def __init__(self, version_string): | |||
include_if.__init__(self, _xspec.get_xsversion() >= version_string) | |||
xspec_version = LooseVersion(_xspec.get_xsversion()) |
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.
Would it make sense to make xspec_version
a module-level "constant", since it shouldn't be something that changes within a test run?
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.
Done.
e2b531b
to
7c46945
Compare
Should there be an explicit check of this message in the tests? In other words, a test with a hard-coded knowledge of what the error message should look like. The idea being that if the error message text is changed, we will get a test failure, which would then let us know to update any accompanying documentation. For this particular test it is likely overkill. |
Yes, that's why this is still WIP and I didn't update the description. I need to make sure it's actually working whether it's through a unit test of even just a local test. I don't even know whether that line is being hit during the tests. I'll get to it asap. |
Rebasing to resolve conflicts and get the latest changes from master (was ffc4cc4) |
61da465
to
765fe8f
Compare
@olaurino - is this something you want reviewing or are you still looking at the test issue (mentioned in #422 (comment) )? |
I was hoping I could test this, even just interactively, I just haven't had any time to do it. |
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 happy to have these merged with or without the tests Omar wanted to do.
765fe8f
to
77db1c5
Compare
Improve the handling of XSPEC versions mismatch.