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+ #writing test python code for testing conda yml
2+ def test_addition ():
3+ assert 1 + 1 == 2
14
2- # sum of numbers
3- import unittest
4- def addition (a ,b ):
5- return a + b
5+ def test_subtraction ():
6+ assert 5 - 3 == 2
67
7-
8- print (addition (2 ,3 )) # Expected output:
9- # sum of numbers
10- def addition (a , b ):
11- """Return the sum of a and b."""
12- return a + b
13-
14- class TestAddition (unittest .TestCase ):
15- def test_basic (self ):
16- self .assertEqual (addition (2 , 3 ), 5 )
17- self .assertEqual (addition (- 1 , 1 ), 0 )
18- self .assertEqual (addition (0 , 0 ), 0 )
19-
20- if __name__ == "__main__" :
21- # Run the tests
22- unittest .main ()
8+ def test_multiplication ():
9+ assert 5 * 2 == 10
2310
2411
2512
Original file line number Diff line number Diff line change 1+ #writing test python code for testing conda yml
2+ def test_addition ():
3+ assert 1 + 1 == 2
4+
5+ def test_subtraction ():
6+ assert 5 - 3 == 2
You can’t perform that action at this time.
0 commit comments