@@ -26,22 +26,22 @@ def test_for_file_output(capsys, app):
26
26
result = get_allStudentColors ()
27
27
assert len (result ) == 10
28
28
29
- from unittest .mock import patch
30
- @pytest .mark .it ('You should use print 10 times' )
31
- @patch ('builtins.print' )
32
- def test_print_times (mock_print ):
33
- # The actual test
34
- # import the function that use print
35
- from app import get_allStudentColors
36
- get_allStudentColors ()
29
+ # from unittest.mock import patch
30
+ # @pytest.mark.it('You should use print 10 times')
31
+ # @patch('builtins.print')
32
+ # def test_print_times(mock_print):
33
+ # # The actual test
34
+ # # import the function that use print
35
+ # from app import get_allStudentColors
36
+ # get_allStudentColors()
37
37
38
- # we need the call format to know how many calls print has.
39
- from mock import call
40
- calls = []
41
- for x in range (10 ):
42
- calls .append (call (x ))
43
- # calls = [call(0),call(1),call(2),call(3),call(4),call(5),call(6),call(7),call(8),call(9)]
44
- mock_print .assert_has_calls (calls , any_order = False ) # set any_order to False to respect the iteration sequence (0,1,2,3,4...etc.)
38
+ # # we need the call format to know how many calls print has.
39
+ # from mock import call
40
+ # calls = []
41
+ # for x in range(10):
42
+ # calls.append(call(x))
43
+ # # calls = [call(0),call(1),call(2),call(3),call(4),call(5),call(6),call(7),call(8),call(9)]
44
+ # mock_print.assert_has_calls(calls, any_order=False) # set any_order to False to respect the iteration sequence (0,1,2,3,4...etc.)
45
45
46
46
47
47
@pytest .mark .it ('You should use for to iterate 10 times' )
0 commit comments