mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
gh-121604: Make sure all deprecated items in importlib raise DeprecationWarning (#128007)
Co-authored-by: rashansmith <smith.rashan@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
b52de22ac3
commit
bd3baa8b1a
8 changed files with 96 additions and 5 deletions
|
|
@ -492,5 +492,18 @@ def test_util(self):
|
|||
support.check__all__(self, util['Source'], extra=extra)
|
||||
|
||||
|
||||
class TestDeprecations(unittest.TestCase):
|
||||
def test_machinery_deprecated_attributes(self):
|
||||
from importlib import machinery
|
||||
attributes = (
|
||||
'DEBUG_BYTECODE_SUFFIXES',
|
||||
'OPTIMIZED_BYTECODE_SUFFIXES',
|
||||
)
|
||||
for attr in attributes:
|
||||
with self.subTest(attr=attr):
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
getattr(machinery, attr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue