Spaces:
Running
Running
Download python_embed/Lib/site-packages/joblib/test/test_utils.py from Aluode/PerceptionLabPortable: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/Aluode/PerceptionLabPortable/resolve/main/python_embed/Lib/site-packages/joblib/test/test_utils.py
- Command line
-
hf download hf://spaces/Aluode/PerceptionLabPortable/python_embed/Lib/site-packages/joblib/test/test_utils.py
-
curl -L -o test_utils.py https://huggingface.co/spaces/Aluode/PerceptionLabPortable/resolve/main/python_embed/Lib/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 | |