File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 1- import pytest
21import inspect
32
4- from app import main
3+ import pytest
4+
5+ from app .main import count_occurrences
6+
57
68@pytest .mark .parametrize (
79 "phrase,letter,count" ,
1214 ("Abracadabra" , "A" , 5 ),
1315 ("" , "a" , 0 ),
1416 ("Samsung" , "b" , 0 ),
15- ]
17+ ],
1618)
1719def test_count_occurrences (phrase , letter , count ):
18- assert main . count_occurrences (phrase , letter ) == count , (
20+ assert count_occurrences (phrase , letter ) == count , (
1921 f"Function 'count_occurrences' should return { count } , "
2022 f"when 'phrase'='{ phrase } ' and 'letter'='{ letter } '"
2123 )
2224
2325
2426def test_removed_comment ():
25- lines = inspect .getsource (main )
26- assert "# write your code here" not in lines , ("You have to"
27- " remove the unnecessary comment '# write your code here'" )
27+ lines = inspect .getsource (count_occurrences )
28+ assert "# write your code here" not in lines , (
29+ "You have to" " remove the unnecessary comment '# write your code here'"
30+ )
You can’t perform that action at this time.
0 commit comments