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

Remove testUtils from package-level imports

    XMLWordPrintable

    Details

    • Urgent?:
      No

      Description

      After discussion on slack[1], we realized that the afw.cameraGeom testUtils assert methods are not loaded in that package's _init_.py, whereas afw.geom (utils.py), afw.image, afw.table, and geom (all testUtils.py) all do so. This results in "automagic" additions to the available assert methods in lsst.utils.tests.TestCase for the latter packages (due the test decorator), but not for cameraGeom. Jim Bosch argued convincingly that we should remove those automagic imports (side effects on import are generally discouraged, and we want our imports to be as fast as possible) and import the necessary packages (possibly with a #noqa: F401 to hide flake8 warnings) in either the obs_base tests or the specific test that uses those asserts. See the slack conversation for details.

      NOTE: I don't know for sure that this won't need an RFC. It only affects tests, so shouldn't modify a production environment, but I'll leave that for others to decide.

      1: https://lsstc.slack.com/archives/C2JPMCF5X/p1658165436078869

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Parejkoj John Parejko
            Watchers:
            Eli Rykoff, Ian Sullivan, Jim Bosch, John Parejko, Kian-Tat Lim, Tim Jenness
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Jenkins

                No builds found.