MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / test_normalize

Function test_normalize

24-class-metaprog/hours/hours_test.py:22–28  ·  view source on GitHub ↗
(hours, expected)

Source from the content-addressed store, hash-verified

20
21@pytest.mark.parametrize('hours, expected', HOURS_TO_HMS)
22def test_normalize(hours, expected):
23 h, m, s = expected
24 got_h, got_m, got_s = normalize(hours * 3600)
25 assert (h, m) == (got_h, got_m)
26 assert isclose(s, got_s, abs_tol=1e-12)
27 got_hours = got_h + got_m / 60 + got_s / 3600
28 assert isclose(hours, got_hours)
29
30
31@pytest.mark.parametrize('h, expected', [

Callers

nothing calls this directly

Calls 1

normalizeFunction · 0.90

Tested by

no test coverage detected