File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed
Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ def add(x, y):
99def divide (x , y ):
1010 """Divides the first parameter by the second
1111 >>> x, y, z = 7, -6.0, 0
12- >>> divide(x, y)
13- -1.1666666666666667
12+ >>> round( divide(x, y), 8 )
13+ -1.16666667
1414 >>> divide(x, z)
1515 Traceback (most recent call last):
1616 File "<stdin>", line 1, in <module>
@@ -21,15 +21,15 @@ def divide(x, y):
2121
2222def multiply (x , y ):
2323 """
24- >>> multiply(7,6)
24+ >>> multiply(7, 6)
2525 42
2626 """
2727 return x * y
2828
2929
3030def subtract (x , y ):
3131 """
32- >>> subtract(7,6)
32+ >>> subtract(7, 6)
3333 1
3434 """
3535 return x - y
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ in a docstring or in another text file are fulfilled.
88
99 .. literalinclude :: arithmetic.py
1010 :language: python
11- :lines: 9-18
11+ :lines: 9-19
1212 :lineno-start: 9
1313
1414#. Then you can test it with:
@@ -28,12 +28,12 @@ in a docstring or in another text file are fulfilled.
2828 Expecting nothing
2929 ok
3030 Trying:
31- divide(x, y)
31+ round( divide(x, y), 8 )
3232 Expecting:
33- -1.1666666666666667
33+ -1.16666667
3434 ok
3535 Trying:
36- divide(x, z )
36+ divide(x, y )
3737 Expecting:
3838 Traceback (most recent call last):
3939 File "<stdin>", line 1, in <module>
@@ -75,9 +75,9 @@ in a docstring or in another text file are fulfilled.
7575 Expecting nothing
7676 ok
7777 Trying:
78- divide(x, y)
78+ round( divide(x, y), 8 )
7979 Expecting:
80- -1.1666666666666667
80+ -1.16666667
8181 ok
8282 Trying:
8383 divide(x, z)
Original file line number Diff line number Diff line change @@ -529,7 +529,7 @@ And fixtures can also use several other fixtures:
529529 @pytest.fixture (scope = " function" )
530530 def populated_db (items_db , items_list ):
531531 """ ItemsDB object populated with 'items_list'"""
532- for i in some_items :
532+ for i in items_list :
533533 items_db.add_item(i)
534534 return items_db
535535
You can’t perform that action at this time.
0 commit comments