Skip to content

Commit

Permalink
Use "wave" for import test
Browse files Browse the repository at this point in the history
smptd and chunk are deprecated in various python versions.
  • Loading branch information
timj committed Nov 29, 2023
1 parent d17c9d6 commit 37844ca
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import os
import sys
import unittest
from collections.abc import Mapping

Expand Down Expand Up @@ -120,21 +119,12 @@ def testPackages(self):
self.assertDictEqual(new.extra(packages), {})

# Now load an obscure python package and the list of packages should
# change
# Shouldn't be used by anything we've previously imported
# smtpd can be used on 3.8 since it does have a version string but
# it is also a deprecated package so should not be used in tests
# for python 3.10 and newer.
# chunk does not have a version string but is handled as a stdlib
# package on 3.10 and newer.
if sys.version_info < (3, 10, 0):
import smtpd # noqa: F401

new_package = "smtpd"
else:
import chunk # noqa: F401

new_package = "chunk"
# change. Shouldn't be used by anything we've previously imported and
# preferably should not be a deprecated package.
new_package = "wave"
self.assertNotIn(new_package, packages)

import wave # noqa: F401

new = lsst.utils.packages.Packages.fromSystem()
self.assertDictEqual(packages.difference(new), {}) # No inconsistencies
Expand Down

0 comments on commit 37844ca

Please sign in to comment.