Download venv/lib/python3.12/site-packages/joblib/test/test_utils.py from anonymous-CAP/cap-hatespeech: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/anonymous-CAP/cap-hatespeech/resolve/main/venv/lib/python3.12/site-packages/joblib/test/test_utils.py
- Command line
-
hf download hf://anonymous-CAP/cap-hatespeech/venv/lib/python3.12/site-packages/joblib/test/test_utils.py
-
curl -L -o test_utils.py https://huggingface.co/anonymous-CAP/cap-hatespeech/resolve/main/venv/lib/python3.12/site-packages/joblib/test/test_utils.py
1.02 kB
| import pytest | |
| from joblib._utils import eval_expr | |
| def test_eval_expr_invalid(expr): | |
| with pytest.raises(ValueError, match="is not a valid or supported arithmetic"): | |
| eval_expr(expr) | |
| def test_eval_expr_too_long(): | |
| expr = "1" + "+1" * 50 | |
| with pytest.raises(ValueError, match="is too long"): | |
| eval_expr(expr) | |
| def test_eval_expr_too_large_literal(expr): | |
| with pytest.raises(ValueError, match="Numeric literal .* is too large"): | |
| eval_expr(expr) | |
| def test_eval_expr_valid(expr, result): | |
| assert eval_expr(expr) == result | |