diff options
author | Sándor Jenei <35337337+SlaushVunter@users.noreply.github.com> | 2021-09-13 11:08:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 17:08:34 +0800 |
commit | bacf23f3edfa2ce880b7cd740d63f10058732fd1 (patch) | |
tree | 7d202151cebe94b0b2fb76948d0822e0c1adcb3c /tests/test_utils.py | |
parent | 7b5634911c892fbc64b363523b8af74a4b772f7b (diff) | |
download | pyca-cryptography-bacf23f3edfa2ce880b7cd740d63f10058732fd1.zip pyca-cryptography-bacf23f3edfa2ce880b7cd740d63f10058732fd1.tar.gz pyca-cryptography-bacf23f3edfa2ce880b7cd740d63f10058732fd1.tar.bz2 |
_ModuleWithDeprecations should inherit from types.ModuleType (#6267) (#6268)
* _ModuleWithDeprecations should inherit from types.ModuleType (#6267)
Update utils.py
* fix typos reported by black
* flake8 fix
* Test should fail when int_from_bytes will be removed.
Because this test would become pointless then.
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 389638f..ee411c3 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -4,6 +4,7 @@ import binascii +import inspect import os import textwrap @@ -12,6 +13,7 @@ import pretend import pytest import cryptography +import cryptography.utils from cryptography.exceptions import UnsupportedAlgorithm, _Reasons import cryptography_vectors @@ -4444,3 +4446,13 @@ def test_raises_unsupported_algorithm(): "An error.", _Reasons.BACKEND_MISSING_INTERFACE ) assert exc_info.type is UnsupportedAlgorithm + + +def test_inspect_deprecated_module(): + # Check if inspection is supported by _ModuleWithDeprecations. + assert isinstance( + cryptography.utils, cryptography.utils._ModuleWithDeprecations + ) + source_file = inspect.getsourcefile(cryptography.utils) + assert isinstance(source_file, str) + assert source_file.endswith("utils.py") |