Build the reflex-release test repository once per session

QU
6d ago
+30-13

Type of change

Test-only performance change (needs the skip-changelog label).

The repo fixture in tests/units/reflex_release/conftest.py created a fresh git repository for each of the 480 reflex_release tests: git remote get-url (via towncrier_config_toml), git init, git add -A and git commit. A session-scoped repo_template fixture now builds that repository once, and repo copies it into tmp_path, so each test still gets its own isolated repository with identical contents.

Measured:

  • Windows (Python 3.14): fixture 510 ms to 73 ms per test; tests/units/reflex_release 248.6 s to 116.5 s. The Windows unit-test jobs run this suite twice each.
  • Linux (python:3.12 container): fixture 27 ms to 16 ms, about 5 s per suite run.

The same 480 test ids are collected before and after and all pass.

  • Have you successfully ran tests with your changes locally?