File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1313 _frozen_importlib_external = _bootstrap_external
1414from ._abc import Loader
1515import abc
16+ import warnings
1617
1718from .resources import abc as _resources_abc
1819
Original file line number Diff line number Diff line change @@ -913,5 +913,27 @@ def test_universal_newlines(self):
913913 SourceOnlyLoaderMock = SPLIT_SOL )
914914
915915
916+ class DeprecatedAttrsTests :
917+
918+ """Test the deprecated attributes can be accessed."""
919+
920+ def test_deprecated_attr_ResourceReader (self ):
921+ with self .assertWarns (DeprecationWarning ):
922+ self .abc .ResourceReader
923+
924+ def test_deprecated_attr_Traversable (self ):
925+ with self .assertWarns (DeprecationWarning ):
926+ self .abc .Traversable
927+
928+ def test_deprecated_attr_TraversableResources (self ):
929+ with self .assertWarns (DeprecationWarning ):
930+ self .abc .TraversableResources
931+
932+
933+ (Frozen_DeprecatedAttrsTests ,
934+ Source_DeprecatedAttrsTests
935+ ) = test_util .test_both (DeprecatedAttrsTests , abc = abc )
936+
937+
916938if __name__ == '__main__' :
917939 unittest .main ()
Original file line number Diff line number Diff line change 1+ Avoid :exc: `NameError ` for the :mod: `warnings ` module when accessing the
2+ depracated atributes of the :mod: `importlib.abc ` module.
You can’t perform that action at this time.
0 commit comments