Skip to content

Testenix v0.2.0 — Safe pytest migration

Choose a tag to compare

@polishdataengineer polishdataengineer released this 20 Jul 21:50
0f39289

Testenix 0.2.0 makes migration from real pytest suites materially more useful while keeping the original test suite untouched.

Highlights

  • Native, dependency-free tmp_path and transactional monkeypatch fixtures.
  • Native autouse fixtures with deterministic setup and teardown ownership.
  • Safe conversion of simple pytest classes using a fresh instance per test.
  • Bare @pytest.mark.asyncio migration with a fresh, closed event loop per test or parametrized case.
  • Static support for common local helpers that receive monkeypatch, while aliases, dynamic rebinding, unsupported methods, and escaping values remain blocked.
  • Fail-closed checks for pytest-asyncio loop scope, debug mode, event_loop_policy, configuration precedence, and relevant PYTEST_ADDOPTS behavior.
  • Clearer migration summaries with complete line-addressed diagnostics available in JSON reports.

Safe migration workflow

python -m pip install --upgrade "testenix[pytest]==0.2.0"
testenix migrate pytest tests --dry-run
testenix migrate pytest tests --check --workers 4

Migration remains copy-only and transactional. Source tests are fingerprinted, source and native outcomes are compared, and the destination is published only after all validation gates pass. Original tests are never deleted or renamed.

Validation

  • 284 project tests passing.
  • CI passing on Python 3.11-3.14 across Linux, macOS, and Windows.
  • Wheel, sdist, Twine, isolated installation, pytest-extra, and migration smoke checks passing.
  • A real 118-test pytest project validated with 118/118 matching outcomes in pytest, native serial, and native parallel modes.

Observed timings from that final validation run were 3.120 s for pytest, 2.870 s for native serial, and 2.423 s for native parallel. These are validation timings, not a substitute for the published multi-round benchmark methodology.

Documentation