Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: utils
-
Labels:
-
Story Points:1
-
Epic Link:
-
Sprint:Alert Production S17 - 5
-
Team:Alert Production
Description
The documentation for utils.getPackageDir claims @throw lsst::pex::exceptions::NotFoundError if desired version can't be found, but it actually raises RuntimeError:
In [1]: import lsst.utils
|
|
In [2]: lsst.utils.getPackageDir('dajfsfsa')
|
---------------------------------------------------------------------------
|
RuntimeError Traceback (most recent call last)
|
<ipython-input-2-bac2a7aa8ca6> in <module>()
|
----> 1 lsst.utils.getPackageDir('dajfsfsa')
|
|
RuntimeError: Package dajfsfsa not found
|
We should either fix the docstring, or fix what is raised (likely at the pybind11 layer).
We also need to fix the GetPackageDirTestCase unittest so that it tests against the correct exception being raised (it currently tests Exception, which is unhelpful).
Why not check against the negative case? If it is a RuntimeError then the test fails. If not, then import the exception and test against it too to be sure you get the right NotFoundError.