feat: améliorations UX roadmap votes #94
- Votes cappés à VOTES_PER_WEEK (pas d'accumulation) pour valoriser les connexions régulières - Solde de votes affiché dans la liste (input inéditable) à la place du bandeau Alert, avec date de prochain rechargement - Compteur de votes par feature affiché comme input inéditable en fin de ligne (avant le bouton "+") - Animation FLIP JS (roadmap_flip.js) : seules les lignes qui changent de position sont animées après un vote - Renommage votes_credited_until → votes_last_credited_at (migration 0005) - Constantes du module utilisées dans les assertions de tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+17
-3
@@ -49,6 +49,9 @@ os.environ["DATA_SCHEMA_CACHE"] = str(_SCHEMA_FIXTURE)
|
||||
os.environ.pop("DATA_SCHEMA_PATH", None)
|
||||
|
||||
|
||||
_DB_BACKUP = _DB_PATH.with_suffix(".duckdb.pytest-backup")
|
||||
|
||||
|
||||
def _cleanup_db_artifacts() -> None:
|
||||
for artifact in (
|
||||
_DB_PATH,
|
||||
@@ -59,19 +62,30 @@ def _cleanup_db_artifacts() -> None:
|
||||
artifact.unlink()
|
||||
|
||||
|
||||
def _backup_db() -> None:
|
||||
if _DB_PATH.exists():
|
||||
_DB_PATH.rename(_DB_BACKUP)
|
||||
|
||||
|
||||
def _restore_db() -> None:
|
||||
_cleanup_db_artifacts()
|
||||
if _DB_BACKUP.exists():
|
||||
_DB_BACKUP.rename(_DB_PATH)
|
||||
|
||||
|
||||
# Runs at conftest import, before test modules import src.db (which builds the
|
||||
# DuckDB at import time). Guarantees the test parquet exists and the stale DB
|
||||
# from a previous `python run.py` is wiped so src.db rebuilds from test data.
|
||||
pl.DataFrame(_TEST_DATA).write_parquet(_PARQUET_PATH)
|
||||
_backup_db()
|
||||
_cleanup_db_artifacts()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def test_data():
|
||||
yield str(_PARQUET_PATH)
|
||||
# Teardown: remove the test DuckDB so the next `python run.py` rebuilds
|
||||
# from decp_prod.parquet.
|
||||
_cleanup_db_artifacts()
|
||||
# Teardown: restore the original DuckDB so the next `python run.py` finds it.
|
||||
_restore_db()
|
||||
|
||||
|
||||
def pytest_setup_options():
|
||||
|
||||
Reference in New Issue
Block a user