..F........FF.................FF....................... [100%] =================================== FAILURES =================================== ________ test_full_unit_name_is_accepted[FAHRENHEIT-expected_targets2] _________ unit = 'FAHRENHEIT', expected_targets = {'C': -3.89, 'F': 25.0, 'K': 269.26} @pytest.mark.parametrize( "unit,expected_targets", [ ("Celsius", {"C": 25.0, "F": 77.0, "K": 298.15}), ("celsius", {"C": 25.0, "F": 77.0, "K": 298.15}), ("FAHRENHEIT", {"C": -3.89, "F": 25.0, "K": 269.26}), ("kelvin", {"C": -248.15, "F": -414.67, "K": 25.0}), ], ) def test_full_unit_name_is_accepted(unit, expected_targets): value = "25" r = _run([value, unit]) assert r.returncode == 0, ( f"'{unit}' birim adi reddedildi; cikti={r.stdout!r} hata={r.stderr!r}" ) out = _lines(r.stdout) assert len(out) == 3, r.stdout got = {} for line in out: m = re.match(r"^\s*(-?\d+\.\d{2})\s*(Celsius|Fahrenheit|Kelvin)\b", line) assert m, f"sonuc satiri okunamadi: {line!r}" letter = m.group(2)[0] got[letter] = float(m.group(1)) for u, want in expected_targets.items(): > assert got[u] == pytest.approx(want, abs=0.011), f"{u}: {r.stdout}" E AssertionError: C: -12.60 Celsius E 25.00 Fahrenheit E 260.55 Kelvin E E assert -12.6 == -3.89 ± 0.011 E E comparison failed E Obtained: -12.6 E Expected: -3.89 ± 0.011 tests/test_review_sicaklik.py:58: AssertionError ___ test_converts_between_all_three_units_with_two_decimals[212-F-expected4] ___ value = '212', unit = 'F', expected = {'C': 100.0, 'F': 212.0, 'K': 373.15} run_cli = @pytest.mark.parametrize( "value,unit,expected", [ ("100", "C", {"C": 100.00, "F": 212.00, "K": 373.15}), ("-40", "C", {"C": -40.00, "F": -40.00, "K": 233.15}), ("25", "C", {"C": 25.00, "F": 77.00, "K": 298.15}), ("32", "F", {"C": 0.00, "F": 32.00, "K": 273.15}), ("212", "F", {"C": 100.00, "F": 212.00, "K": 373.15}), ("98.6", "F", {"C": 37.00, "F": 98.60, "K": 310.15}), ("273.15", "K", {"C": 0.00, "F": 32.00, "K": 273.15}), ("300", "K", {"C": 26.85, "F": 80.33, "K": 300.00}), ("373.15", "K", {"C": 100.00, "F": 212.00, "K": 373.15}), ], ) def test_converts_between_all_three_units_with_two_decimals(value, unit, expected, run_cli): r = run_cli([value, unit]) assert r.returncode == 0, r.stderr got = by_unit(r.stdout) assert set(got) == {"C", "F", "K"}, r.stdout for u, want in expected.items(): > assert got[u] == pytest.approx(want, abs=0.011), f"{u}: {r.stdout}" E AssertionError: C: 324.00 Celsius E 212.00 Fahrenheit E 597.15 Kelvin E E assert 324.0 == 100.0 ± 0.011 E E comparison failed E Obtained: 324.0 E Expected: 100.0 ± 0.011 tests/test_sicaklik.py:60: AssertionError __ test_converts_between_all_three_units_with_two_decimals[98.6-F-expected5] ___ value = '98.6', unit = 'F', expected = {'C': 37.0, 'F': 98.6, 'K': 310.15} run_cli = @pytest.mark.parametrize( "value,unit,expected", [ ("100", "C", {"C": 100.00, "F": 212.00, "K": 373.15}), ("-40", "C", {"C": -40.00, "F": -40.00, "K": 233.15}), ("25", "C", {"C": 25.00, "F": 77.00, "K": 298.15}), ("32", "F", {"C": 0.00, "F": 32.00, "K": 273.15}), ("212", "F", {"C": 100.00, "F": 212.00, "K": 373.15}), ("98.6", "F", {"C": 37.00, "F": 98.60, "K": 310.15}), ("273.15", "K", {"C": 0.00, "F": 32.00, "K": 273.15}), ("300", "K", {"C": 26.85, "F": 80.33, "K": 300.00}), ("373.15", "K", {"C": 100.00, "F": 212.00, "K": 373.15}), ], ) def test_converts_between_all_three_units_with_two_decimals(value, unit, expected, run_cli): r = run_cli([value, unit]) assert r.returncode == 0, r.stderr got = by_unit(r.stdout) assert set(got) == {"C", "F", "K"}, r.stdout for u, want in expected.items(): > assert got[u] == pytest.approx(want, abs=0.011), f"{u}: {r.stdout}" E AssertionError: C: 119.88 Celsius E 98.60 Fahrenheit E 393.03 Kelvin E E assert 119.88 == 37.0 ± 0.011 E E comparison failed E Obtained: 119.88 E Expected: 37.0 ± 0.011 tests/test_sicaklik.py:60: AssertionError ______________ test_unit_letter_is_case_insensitive[212-f-100.0] _______________ value = '212', unit = 'f', expected_c = 100.0 run_cli = @pytest.mark.parametrize( "value,unit,expected_c", [ ("100", "c", 100.0), ("100", "C", 100.0), ("212", "f", 100.0), ("212", "F", 100.0), ("373.15", "k", 100.0), ("373.15", "K", 100.0), ], ) def test_unit_letter_is_case_insensitive(value, unit, expected_c, run_cli): r = run_cli([value, unit]) assert r.returncode == 0, r.stderr > assert by_unit(r.stdout)["C"] == pytest.approx(expected_c, abs=0.011), r.stdout E AssertionError: 324.00 Celsius E 212.00 Fahrenheit E 597.15 Kelvin E E assert 324.0 == 100.0 ± 0.011 E E comparison failed E Obtained: 324.0 E Expected: 100.0 ± 0.011 tests/test_sicaklik.py:122: AssertionError ______________ test_unit_letter_is_case_insensitive[212-F-100.0] _______________ value = '212', unit = 'F', expected_c = 100.0 run_cli = @pytest.mark.parametrize( "value,unit,expected_c", [ ("100", "c", 100.0), ("100", "C", 100.0), ("212", "f", 100.0), ("212", "F", 100.0), ("373.15", "k", 100.0), ("373.15", "K", 100.0), ], ) def test_unit_letter_is_case_insensitive(value, unit, expected_c, run_cli): r = run_cli([value, unit]) assert r.returncode == 0, r.stderr > assert by_unit(r.stdout)["C"] == pytest.approx(expected_c, abs=0.011), r.stdout E AssertionError: 324.00 Celsius E 212.00 Fahrenheit E 597.15 Kelvin E E assert 324.0 == 100.0 ± 0.011 E E comparison failed E Obtained: 324.0 E Expected: 100.0 ± 0.011 tests/test_sicaklik.py:122: AssertionError ----------------- generated xml file: /work/creovum-report.xml ----------------- =========================== short test summary info ============================ FAILED tests/test_review_sicaklik.py::test_full_unit_name_is_accepted[FAHRENHEIT-expected_targets2] FAILED tests/test_sicaklik.py::test_converts_between_all_three_units_with_two_decimals[212-F-expected4] FAILED tests/test_sicaklik.py::test_converts_between_all_three_units_with_two_decimals[98.6-F-expected5] FAILED tests/test_sicaklik.py::test_unit_letter_is_case_insensitive[212-f-100.0] FAILED tests/test_sicaklik.py::test_unit_letter_is_case_insensitive[212-F-100.0] 5 failed, 50 passed in 6.07s