Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-10415

import lsst.pex.exceptions in all top-level __init__.py

    Details

    • Templates:
    • Story Points:
      2

      Description

      Investigating DM-10401, I discovered that LSST code does not raise the correct exception unless the user has done import lsst.pex.exceptions first (RuntimeError gets raised instead). We can fix this by putting that import in every package's top-level _init_.py.

      Unittests for this are tricky, though, because to use assertRaises(lsst.pex.exceptions.SomeError, you have to have imported pex.exceptions first, which means you aren't actually testing that the "internal" import happened. I proposed one solution in a comment on DM-10401, but I don't like it. We might have to satisfy ourselves with just putting the pex.exceptions import in our top-level _init_.py and hoping that's enough?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Parejkoj John Parejko
                Watchers:
                John Parejko, John Swinbank, Pim Schellart [X] (Inactive), Russell Owen, Simon Krughoff, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel