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 13
13
_frozen_importlib_external = _bootstrap_external
14
14
from ._abc import Loader
15
15
import abc
16
+ import warnings
16
17
17
18
from .resources import abc as _resources_abc
18
19
Original file line number Diff line number Diff line change @@ -913,5 +913,27 @@ def test_universal_newlines(self):
913
913
SourceOnlyLoaderMock = SPLIT_SOL )
914
914
915
915
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
+
916
938
if __name__ == '__main__' :
917
939
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