Download tests/ci/unit/test_regression_suite.py from jun2024/fc: direct link, hf CLI and curl.
- Browser
- Download file 761 Bytes
-
https://huggingface.co/spaces/jun2024/fc/resolve/main/tests/ci/unit/test_regression_suite.py
- Command line
-
hf download hf://spaces/jun2024/fc/tests/ci/unit/test_regression_suite.py
-
curl -L -o test_regression_suite.py https://huggingface.co/spaces/jun2024/fc/resolve/main/tests/ci/unit/test_regression_suite.py
761 Bytes
| """Import smoke for tracked CI unit test modules.""" | |
| from __future__ import annotations | |
| from importlib import import_module | |
| from pathlib import Path | |
| import pytest | |
| from django.core.cache import cache | |
| def _tracked_unit_modules() -> list[str]: | |
| unit_dir = Path(__file__).resolve().parent | |
| this_module = Path(__file__).stem | |
| return sorted( | |
| f"tests.ci.unit.{path.stem}" | |
| for path in unit_dir.glob("test_*.py") | |
| if path.is_file() and path.stem != this_module | |
| ) | |
| def _clear_ci_cache() -> None: | |
| cache.clear() | |
| def test_tracked_ci_unit_modules_are_importable() -> None: | |
| modules = _tracked_unit_modules() | |
| assert modules | |
| for module_name in modules: | |
| import_module(module_name) | |