回答編集履歴
1
追記
answer
CHANGED
@@ -6,4 +6,12 @@
|
|
6
6
|
def test_tashizan_3(self):
|
7
7
|
with self.assertRaises(SystemExit):
|
8
8
|
tashizan("a", "6")
|
9
|
-
```
|
9
|
+
```
|
10
|
+
|
11
|
+
あるいは
|
12
|
+
```Python
|
13
|
+
def test_tashizan_3(self):
|
14
|
+
self.assertRaises(SystemExit, lambda: tashizan("a", "6"))
|
15
|
+
```
|
16
|
+
|
17
|
+
**参考**: [unittest --- ユニットテストフレームワーク — Python 3.7.4 ドキュメント](https://docs.python.org/ja/3/library/unittest.html#unittest.TestCase.assertRaises)
|