import pytest
from fuel import convert, gauge
@pytest.mark.parametrize(
"input, expected",
[
("3/4", 75),
],
)
def test_convert(input, expected):
assert convert(input) == expected
@pytest.mark.parametrize(
"input",
[
"10/3",
],
)
def test_convert_value_error(input):
with pytest.raises(ValueError):
assert convert(input)
@pytest.mark.parametrize(
"input",
[
"0/0"
],
)
def test_convert_zero_division(input):
with pytest.raises(ZeroDivisionError):
convert(input)
@pytest.mark.parametrize(
"input,expected",
[
(75, "75%"), (33, "33%"), (67, "67%"), (0, "E"), (1, "E"), (100, "F"), (99, "F"), (101, "F"), (-1, "E"),
],
)
def test_gauge(input, expected):
assert gauge(input) == expected
Preconditions
test_fuel.py, which passes the check50 validation:Steps to reproduce:
test_fuel.py:check50 cs50/problems/2022/python/tests/fuelExpected result
Actual result
The problem description for PSET 5 Refueling has the following description:

The check50 validation fails at step 2
:( correct fuel.py passes all test_fuel checksIf user attempts to add a test for the requirementthe nearest int between 0 and 100, inclusive.:When the test is enabled:

When skipping the test:
