Pythonのバージョンを3.6.1から3.9.10に上げて、pytestを実行したらエラーが出るようになりました。。
エラー文言を検索して解決策を調べたのですが、わからないのでご回答いただけると嬉しいです。
==================================================== FAILURES ==================================================== _____________________________________ TestAESCipher.test_encrypt_and_decrypt _____________________________________ mocker = <test_backlog_setting_util.TestAESCipher object at 0x7f910bc3c790> def test_encrypt_and_decrypt(mocker): key = "abcde" raw = "qwerty123456" cipher = AESCipher(key) > encripted = cipher.encrypt(raw) tests/escalation_api/backlog/backlog_setting/util/test_backlog_setting_util.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../resource/escalation_api/api/backlog/backlog_setting/util/__init__.py:14: in encrypt iv = Random.get_random_bytes(AES.block_size) /.pyenv/versions/3.9.10/lib/python3.9/site-packages/Crypto/Random/__init__.py:41: in get_random_bytes return _UserFriendlyRNG.get_random_bytes(n) /.pyenv/versions/3.9.10/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py:228: in get_random_bytes return _get_singleton().read(n) /.pyenv/versions/3.9.10/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py:178: in read return _UserFriendlyRNG.read(self, bytes) /.pyenv/versions/3.9.10/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py:129: in read self._ec.collect() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Crypto.Random._UserFriendlyRNG._EntropyCollector object at 0x7f910f452ee0> def collect(self): # Collect 64 bits of entropy from the operating system and feed it to Fortuna. self._osrng_es.feed(self._osrng.read(8)) # Add the fractional part of time.time() t = time.time() self._time_es.feed(struct.pack("@I", int(2**30 * (t - floor(t))))) # Add the fractional part of time.clock() > t = time.clock() E AttributeError: module 'time' has no attribute 'clock' /.pyenv/versions/3.9.10/lib/python3.9/site-packages/Crypto/Random/_UserFriendlyRNG.py:77: AttributeError

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。