Download benchmark/python/py-relevant-negative-fraction/initial.patch from RedinGhost/beforedone-paper: direct link, hf CLI and curl.
- Browser
- Download file 710 Bytes
-
https://huggingface.co/datasets/RedinGhost/beforedone-paper/resolve/main/benchmark/python/py-relevant-negative-fraction/initial.patch
- Command line
-
hf download hf://datasets/RedinGhost/beforedone-paper/benchmark/python/py-relevant-negative-fraction/initial.patch
-
curl -L -o initial.patch https://huggingface.co/datasets/RedinGhost/beforedone-paper/resolve/main/benchmark/python/py-relevant-negative-fraction/initial.patch
710 Bytes
| diff --git a/tests/test_number.py b/tests/test_number.py | |
| index 78639c3..0157da3 100644 | |
| --- a/tests/test_number.py | |
| +++ b/tests/test_number.py | |
| def test_fractional(test_input: float | str, expected: str) -> None: | |
| assert humanize.fractional(test_input) == expected | |
| +def test_fractional_accepts_a_denominator_limit() -> None: | |
| + assert humanize.fractional(0.333, max_denominator=8) == "1/3" | |
| + assert humanize.fractional(2.2, max_denominator=4) == "2 1/4" | |
| + assert humanize.fractional(-2.2, max_denominator=4) == "-2 1/4" | |
| + with pytest.raises(ValueError): | |
| + humanize.fractional(0.5, max_denominator=0) | |
| + | |
| + | |
| @pytest.mark.parametrize( | |
| "test_args, expected", | |
| [ | |