File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # placeholder file to modularize (to package) .py files under the directory "funcs", making the files importable.
1+ # placeholder file to modularize (to package) .py files
2+ # under the directory "funcs", making the files importable.
Original file line number Diff line number Diff line change 11def sum (x : float , y : float ) -> float :
22 return x + y
33
4- def misformatted_func (
5- var1 , var2 , var3
6- ):
4+
5+ # def misformatted_func(
6+ # var1, var2, var3
7+ # ):
8+ # print(var1, var2, var3)
9+
10+
11+ def corr_formatted_func (var1 , var2 , var3 ):
712 print (var1 , var2 , var3 )
Original file line number Diff line number Diff line change 1- # placeholder file to modularize (to package) .py files under the directory "tests", making the files importable.
1+ # placeholder file to modularize (to package) .py files
2+ # under the directory "tests", making the files importable.
Original file line number Diff line number Diff line change @@ -7,10 +7,16 @@ class Test(unittest.TestCase):
77 def test_sum (self ):
88 self .assertEqual (func .sum (2 ,3 ), 5 )
99
10- @patch ('funcs.func.misformatted_func' )
11- def test_misformatted_func (self , mock_misformatted_func ):
12- func .misformatted_func ("one" , "two" , "three" )
13- mock_misformatted_func .assert_called_with ("one" , "two" , "three" )
10+ # Any misformatted functions would not pass flake8 format checks. All related tests would not be executed.
11+ # @patch('funcs.func.misformatted_func')
12+ # def test_misformatted_func(self, mock_misformatted_func):
13+ # func.misformatted_func("one", "two", "three")
14+ # mock_misformatted_func.assert_called_with("one", "two", "three")
15+
16+ @patch ('funcs.func.corr_formatted_func' )
17+ def test_corr_formatted_func (self , mock_corr_formatted_func ):
18+ func .corr_formatted_func ("one" , "two" , "three" )
19+ mock_corr_formatted_func .assert_called_with ("one" , "two" , "three" )
1420
1521if __name__ == "__main__" :
1622 unittest .main ()
You can’t perform that action at this time.
0 commit comments