Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .coverage
Binary file not shown.
Binary file modified __pycache__/functions.cpython-313.pyc
Binary file not shown.
Binary file modified __pycache__/test_functions.cpython-313-pytest-8.3.5.pyc
Binary file not shown.
15 changes: 9 additions & 6 deletions coverage.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" ?>
<coverage version="7.7.1" timestamp="1743047027886" lines-valid="16" lines-covered="14" line-rate="0.875" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<coverage version="7.7.1" timestamp="1743048031240" lines-valid="19" lines-covered="19" line-rate="1" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.7.1 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>C:\Users\KIMHON\Source\Repos\example-ci</source>
</sources>
<packages>
<package name="." line-rate="0.875" branch-rate="0" complexity="0">
<package name="." line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="functions.py" filename="functions.py" complexity="0" line-rate="0.75" branch-rate="0">
<class name="functions.py" filename="functions.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="0"/>
<line number="8" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="0"/>
<line number="11" hits="1"/>
</lines>
</class>
<class name="test_functions.py" filename="test_functions.py" complexity="0" line-rate="1" branch-rate="0">
Expand All @@ -30,8 +30,11 @@
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="1"/>
<line number="16" hits="1"/>
<line number="17" hits="1"/>
<line number="18" hits="1"/>
</lines>
</class>
</classes>
Expand Down
2 changes: 1 addition & 1 deletion functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def multiply(a, b):
return a * b

def convert_fahrenheit_to_celsius(fahrenheit):
return multiply(subtract(fahrenheit, 32), 9 / 5) # <-- Fix this in step 7
return multiply(subtract(fahrenheit, 32), 5 / 9) # <-- Fix this in step 7
10 changes: 5 additions & 5 deletions test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ def test_add():
assert add(2, 3) == 5
assert add('space', 'ship') == 'spaceship'


# uncomment the following test in step 5
def test_subtract():
assert subtract(2, 3) == -1


# uncomment the following test in step 11
# def test_convert_fahrenheit_to_celsius():
# assert f2c(32) == 0
# assert f2c(122) == pytest.approx(50)
# with pytest.raises(AssertionError):
# f2c(-600)
def test_convert_fahrenheit_to_celsius():
assert f2c(32) == 0
assert f2c(122) == pytest.approx(50)