質問編集履歴

3

修正

2022/08/04 03:30

投稿

jetstream
jetstream

スコア65

test CHANGED
File without changes
test CHANGED
@@ -1,10 +1,5 @@
1
1
  pytest を実行した時に AttributeError: module 're' has no attribute '_pattern_type' のエラーが出て、確認しています。
2
2
  エラーの内容は下記になります。
3
- エラーが出たファイルが
4
- ```
5
- /.pyenv/versions/3.9.10/lib/python3.9/site-packages/moto/packages/responses/responses.py
6
- ```
7
- となっているので、site-packagesにインストールされているmotoライブラリのバージョンの問題かなと思ったのですが、motoのバージョンを上げることが正しい解決策でしょうか?
8
3
 
9
4
  ```ここに言語を入力
10
5
  tests/scenario_update/test_scenario_update.py:66: in setup_mock
@@ -71,10 +66,17 @@
71
66
 
72
67
  ```
73
68
 
69
+ エラーが出たファイルが
70
+ ```
71
+ /.pyenv/versions/3.9.10/lib/python3.9/site-packages/moto/packages/responses/responses.py
72
+ ```
73
+ となっているので、site-packagesにインストールされているmotoライブラリのバージョンの問題かなと思ったのですが、motoのバージョンを上げることが正しい解決策でしょうか?
74
+
74
75
  docker buildする際に、requirements.txtでライブラリをインストールしていて、motoのバージョンは1.1.13を指定しています。
75
76
 
76
77
  Python3.6 だった時は moto のバージョン1.1.13 で問題なく動作していましたが、今回Pyrhon3.9に上げてから pytest で失敗するようになりました。
77
78
 
79
+ 【追記】
78
80
  試しにmoto の最新バージョン3.1.16 に上げたら
79
81
  ```ここに言語を入力
80
82
  ImportError: cannot import name 'mock_rds_deprecated' from 'moto'
@@ -89,7 +91,7 @@
89
91
  No broken requirements found.
90
92
  ```
91
93
 
92
- requirements.txt
94
+ requirements.txt(moto の最新バージョン3.1.16 に上げた後)
93
95
  ```ここに言語を入力
94
96
  requests
95
97
  boto3==1.9.201

2

修正

2022/08/04 03:26

投稿

jetstream
jetstream

スコア65

test CHANGED
File without changes
test CHANGED
@@ -75,7 +75,11 @@
75
75
 
76
76
  Python3.6 だった時は moto のバージョン1.1.13 で問題なく動作していましたが、今回Pyrhon3.9に上げてから pytest で失敗するようになりました。
77
77
 
78
- 試しにmoto の最新バージョン3.1.16 に上げたら別のエラーが出て、情報があまり出てこず、詰まっています。
78
+ 試しにmoto の最新バージョン3.1.16 に上げたら
79
+ ```ここに言語を入力
80
+ ImportError: cannot import name 'mock_rds_deprecated' from 'moto'
81
+ ```
82
+ というエラーが出て、情報があまり出てこず、詰まっています。
79
83
  上げるバージョンの問題でしょうか?
80
84
 
81
85
  最新バージョン3.1.16 に上げた後に pip check で 依存関係を確認しましたが、問題ないみたいです。

1

修正

2022/08/04 03:22

投稿

jetstream
jetstream

スコア65

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,6 @@
1
+ pytest を実行した時に AttributeError: module 're' has no attribute '_pattern_type' のエラーが出て、確認しています。
2
+ エラーの内容は下記になります。
1
- 下記はpytest を実行した時に出たエラーです、エラーが出たファイルが
3
+ エラーが出たファイルが
2
4
  ```
3
5
  /.pyenv/versions/3.9.10/lib/python3.9/site-packages/moto/packages/responses/responses.py
4
6
  ```