Skip to content

Commit e0ed1c3

Browse files
committed
test
1 parent d349271 commit e0ed1c3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/.ipynb_checkpoints/test_Literals_in_Python-checkpoint.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 3,
66
"id": "dde59e44-56d2-43cb-a9c7-dc5a07d96d1f",
77
"metadata": {},
88
"outputs": [],
@@ -13,16 +13,16 @@
1313
"def test_number_input():\n",
1414
" \"\"\"Tests number input with mocked input.\"\"\"\n",
1515
" with patch('builtins.input', side_effect=['10', '5']):\n",
16-
" first_number = input('Enter your first number :')\n",
17-
" second_number = input('Enter your second number :')\n",
16+
" first_number = patch.return_value \n",
17+
" second_number = patch.return_value \n",
1818
" sum_of_num = int(first_number) + int(second_number)\n",
1919
" assert sum_of_num == 15\n",
2020
"\n",
2121
"def test_number_input_second_way():\n",
2222
" \"\"\"Tests number input with mocked input (second way).\"\"\"\n",
23-
" with patch('builtins.input', side_effect=['10', '5']):\n",
24-
" first_number = int(input('Enter your first number :'))\n",
25-
" second_number = int(input('Enter your second number :'))\n",
23+
" with patch('builtins.input', side_effect=['10', '5']) as mock_input:\n",
24+
" first_number = int(mock_input())\n",
25+
" second_number = int(mock_input())\n",
2626
" sum_of_num = first_number + second_number\n",
2727
" assert sum_of_num == 15"
2828
]

0 commit comments

Comments
 (0)